ignition activities

This commit is contained in:
Peli de Halleux 2018-01-05 21:40:11 -08:00
parent ac0a7b326f
commit 81f406c6cc
3 changed files with 47 additions and 2 deletions

View File

@ -109,6 +109,26 @@
"description": "Activity 3", "description": "Activity 3",
"url":"/coding/reverse-beeper-3", "url":"/coding/reverse-beeper-3",
"cardType": "example" "cardType": "example"
} }]
] ```
## Ignition
```codecard
[{
"name": "Ignition",
"description": "Activity 1",
"url":"/coding/ingition-1",
"cardType": "example"
}, {
"name": "Ignition",
"description": "Activity 2",
"url":"/coding/ignition-2",
"cardType": "example"
}, {
"name": "Ignition",
"description": "Activity 3",
"url":"/coding/ignition-3",
"cardType": "example"
}]
``` ```

12
docs/coding/ignition-2.md Normal file
View File

@ -0,0 +1,12 @@
# Ignition Activity 2
```blocks
while (true) {
if (sensors.touch1.wasPressed() &&
sensors.ultrasonic4.distance() < 10) {
music.playSoundEffectUntilDone(sounds.mechanicalMotorStart)
music.playSoundEffectUntilDone(sounds.mechanicalMotorIdle);
}
loops.pause(1);
}
```

13
docs/coding/ignition-3.md Normal file
View File

@ -0,0 +1,13 @@
# Ignition Activity 3
```blocks
while (true) {
if (sensors.ultrasonic4.distance() < 10 &&
sensors.touch1.wasPressed() &&
brick.buttonEnter.wasPressed()) {
music.playSoundEffectUntilDone(sounds.mechanicalMotorStart)
music.playSoundEffectUntilDone(sounds.mechanicalMotorIdle);
}
loops.pause(1);
}
```