fixed pin-pressed
This commit is contained in:
parent
e29216c709
commit
9641c4b5ec
@ -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)),
|
||||||
|
Loading…
Reference in New Issue
Block a user