From b3e5e41dbc27c695308010c3d2f0ac5b5f85e0e7 Mon Sep 17 00:00:00 2001 From: Tom Ball Date: Mon, 24 Jul 2017 10:23:43 -0700 Subject: [PATCH] add a new project --- docs/projects/atronix-jam.md | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/projects/atronix-jam.md diff --git a/docs/projects/atronix-jam.md b/docs/projects/atronix-jam.md new file mode 100644 index 00000000..abe8ee79 --- /dev/null +++ b/docs/projects/atronix-jam.md @@ -0,0 +1,45 @@ +# Artronix Jam + +## Jeepers Bleepers Script 1 + +This script blinks 3 LEDs on Pins 0, 1 and 2 + +```block +// Loop 3 blinking LEDs forever. +while(true) { + // turn LEDS off + pins.digitalWritePin(DigitalPin.P0, 0) + basic.pause(500) + pins.digitalWritePin(DigitalPin.P1, 0) + basic.pause(500) + pins.digitalWritePin(DigitalPin.P2, 0) + basic.pause(500) + + // turn LEDs on. + pins.digitalWritePin(DigitalPin.P0, 1) + basic.pause(500) + pins.digitalWritePin(DigitalPin.P1, 1) + basic.pause(500) + pins.digitalWritePin(DigitalPin.P2, 1) + basic.pause(500) +} +``` + +# Jeepers Bleepers Script 2 + +This script makes a single LED pulse on and off using 'pulse width modulation'. +```block +while (true) { + for (let i = 0; i <= 128; i++) { + pins.analogWritePin(AnalogPin.P0, i) + basic.pause(10) + } + for (let i = 128; i >= 0; i--) { + pins.analogWritePin(AnalogPin.P0, i) + basic.pause(10) + } +} +``` + + + \ No newline at end of file