From 81f406c6cc2d4dbbfa0c477180a1dd4586a5940f Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 5 Jan 2018 21:40:11 -0800 Subject: [PATCH] ignition activities --- docs/coding.md | 24 ++++++++++++++++++++++-- docs/coding/ignition-2.md | 12 ++++++++++++ docs/coding/ignition-3.md | 13 +++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 docs/coding/ignition-2.md create mode 100644 docs/coding/ignition-3.md diff --git a/docs/coding.md b/docs/coding.md index 071a1834..2c7b39c2 100644 --- a/docs/coding.md +++ b/docs/coding.md @@ -109,6 +109,26 @@ "description": "Activity 3", "url":"/coding/reverse-beeper-3", "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" +}] +``` \ No newline at end of file diff --git a/docs/coding/ignition-2.md b/docs/coding/ignition-2.md new file mode 100644 index 00000000..be38394e --- /dev/null +++ b/docs/coding/ignition-2.md @@ -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); +} +``` diff --git a/docs/coding/ignition-3.md b/docs/coding/ignition-3.md new file mode 100644 index 00000000..c85dcceb --- /dev/null +++ b/docs/coding/ignition-3.md @@ -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); +} +```