update input blocks in docs and tests

This commit is contained in:
Amerlander
2020-02-20 04:01:37 +01:00
parent 38cf0ec0c6
commit c2cdcaa40f
62 changed files with 109 additions and 115 deletions

View File

@ -126,7 +126,4 @@
<block type="device_pin_event" x="555" y="96">
<field name="name">TouchPin.P2</field>
</block>
<block type="device_pin_released" x="188" y="435">
<field name="NAME">TouchPin.P2</field>
</block>
</xml>

View File

@ -350,9 +350,6 @@
<shadow type="math_number" id="RP?w4vFS1wB4I0nNyldb">
<field name="NUM">0</field>
</shadow>
<block type="device_pin_is_pressed">
<field name="NAME">TouchPin.P2</field>
</block>
</value>
<next>
<block type="variables_set">

View File

@ -22,10 +22,10 @@ enum RadioMessage {
heart,
skull
}
input.onButtonPressed(Button.A, function () {
input.input.onButtonEvent(Button.A, ButtonEvent.Click, function () {
radio.sendMessage(RadioMessage.heart)
})
input.onButtonPressed(Button.B, function () {
input.input.onButtonEvent(Button.B, ButtonEvent.Click, function () {
radio.sendMessage(RadioMessage.skull)
})
radio.onReceivedMessage(RadioMessage.heart, function () {

View File

@ -20,10 +20,10 @@ enum RadioMessage {
heart,
skull
}
input.onButtonPressed(Button.A, function () {
input.input.onButtonEvent(Button.A, ButtonEvent.Click, function () {
radio.sendMessage(RadioMessage.heart)
})
input.onButtonPressed(Button.B, function () {
input.input.onButtonEvent(Button.B, ButtonEvent.Click, function () {
radio.sendMessage(RadioMessage.skull)
})
radio.onReceivedMessage(RadioMessage.heart, function () {

View File

@ -332,12 +332,12 @@ function checkBufferEqual(a: Buffer, b: Buffer) {
return true;
}
input.onButtonPressed(Button.A, function () {
input.input.onButtonEvent(Button.A, ButtonEvent.Click, function () {
basic.showString("S");
initSender();
})
input.onButtonPressed(Button.B, function () {
input.input.onButtonEvent(Button.B, ButtonEvent.Click, function () {
basic.showString("R");
initReceiver();
})