fixed pin-pressed

This commit is contained in:
Peli de Halleux 2017-02-02 23:26:55 -08:00
parent e29216c709
commit 9641c4b5ec

View File

@ -21,7 +21,7 @@ Use pin press to switch guitar play on/off
## Blocks ## Blocks
```cards ```cards
var on = false let on = false
on; on;
if (on) { } else {} if (on) { } else {}
input.onPinPressed(TouchPin.P1, () => {}) input.onPinPressed(TouchPin.P1, () => {})
@ -106,7 +106,7 @@ input.onPinPressed(TouchPin.P1, () => {
*Final code* *Final code*
TODO: do we want to use `on = !on;` or be more direct in flipping the switch? `on = true; on = false;` TODO: do we want to use `on = !on;` or be more direct in flipping the switch? `on = true; on = false;`
```blocks ```blocks
var on = false let on = false
basic.forever(() => { basic.forever(() => {
if (on) { if (on) {
music.setTempo(pins.map(Math.abs(input.acceleration(Dimension.Y)), music.setTempo(pins.map(Math.abs(input.acceleration(Dimension.Y)),