Updates for V4 (#197)
* update yotta defaults for 16kb devices * refactor deprecated blocks * updates for button events * update button events * update refference * update docs * update docs * update button event blocks * update docs * update block id
This commit is contained in:
@ -36,10 +36,10 @@ let arrows = images.createBigImage(`
|
||||
. . # . . . # # # .
|
||||
. . # . . . . # . .
|
||||
`);
|
||||
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
|
||||
input.onButtonEvent(Button.A, input.buttonEventClick(), () => {
|
||||
arrows.showImage(0);
|
||||
});
|
||||
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
|
||||
input.onButtonEvent(Button.B, input.buttonEventClick(), () => {
|
||||
arrows.showImage(5);
|
||||
});
|
||||
```
|
||||
|
@ -25,7 +25,7 @@ arrow and show it on the LED screen. If you press button `B`, the
|
||||
program will show a picture of the arrow upside-down.
|
||||
|
||||
```blocks
|
||||
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
|
||||
input.onButtonEvent(Button.A, input.buttonEventClick(), () => {
|
||||
images.createImage(`
|
||||
. . # . .
|
||||
. # # # .
|
||||
@ -34,7 +34,7 @@ input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
|
||||
. . # . .
|
||||
`).showImage(0);
|
||||
});
|
||||
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
|
||||
input.onButtonEvent(Button.B, input.buttonEventClick(), () => {
|
||||
images.createImage(`
|
||||
. . # . .
|
||||
. . # . .
|
||||
|
@ -20,14 +20,10 @@ Show a happy face when button A is pressed or a sad face when button B is presse
|
||||
let iamHappy = images.iconImage(IconNames.Happy)
|
||||
let iamSad = images.iconImage(IconNames.Sad)
|
||||
|
||||
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
|
||||
input.onButtonEvent(Button.A, input.buttonEventClick(), () => {
|
||||
iamHappy.showImage(0);
|
||||
});
|
||||
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
|
||||
input.onButtonEvent(Button.B, input.buttonEventClick(), () => {
|
||||
iamSad.showImage(0);
|
||||
});
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
[arrow image](/reference/images/arrow-image)
|
@ -31,10 +31,10 @@ let arrows = images.createBigImage(`
|
||||
. . # . . . # # # .
|
||||
. . # . . . . # . .
|
||||
`);
|
||||
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
|
||||
input.onButtonEvent(Button.A, input.buttonEventClick(), () => {
|
||||
arrows.showImage(0);
|
||||
});
|
||||
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
|
||||
input.onButtonEvent(Button.B, input.buttonEventClick(), () => {
|
||||
arrows.showImage(5);
|
||||
});
|
||||
```
|
||||
|
Reference in New Issue
Block a user