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:
Juri Wolf
2022-08-10 18:36:19 +02:00
committed by GitHub
parent 32783f38ba
commit 5f7a8e5301
107 changed files with 1218 additions and 706 deletions

View File

@ -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);
});
```

View File

@ -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(`
. . # . .
. . # . .

View File

@ -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)

View File

@ -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);
});
```