The preloaded firmware shipped on the mBuino Development Board.

Dependencies:   mbed

Committer:
Experiment626
Date:
Sat Sep 13 03:20:40 2014 +0000
Revision:
0:c72235e68f52
Child:
1:f89a6b63eae7
Official mBuino Firmware 1.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Experiment626 0:c72235e68f52 1 #include "mbed.h"
Experiment626 0:c72235e68f52 2
Experiment626 0:c72235e68f52 3 DigitalOut LED[] = {(LED1), (LED2), (LED3), (LED4), (LED5), (LED6), (LED7)};// declare 7 LEDs
Experiment626 0:c72235e68f52 4
Experiment626 0:c72235e68f52 5 float delayTime = .05;
Experiment626 0:c72235e68f52 6
Experiment626 0:c72235e68f52 7 int main()
Experiment626 0:c72235e68f52 8 {
Experiment626 0:c72235e68f52 9 while(1)
Experiment626 0:c72235e68f52 10 {
Experiment626 0:c72235e68f52 11 delayTime = 0.05;
Experiment626 0:c72235e68f52 12 for(int x = 0; x < 7; x++)
Experiment626 0:c72235e68f52 13 {
Experiment626 0:c72235e68f52 14 LED[x] = 1; // turn on
Experiment626 0:c72235e68f52 15 wait(.2); // delay
Experiment626 0:c72235e68f52 16
Experiment626 0:c72235e68f52 17 LED[x] = 0; // turn off
Experiment626 0:c72235e68f52 18 wait(delayTime); // delay
Experiment626 0:c72235e68f52 19 }
Experiment626 0:c72235e68f52 20 for(int x = 6; x >= 0; x--)
Experiment626 0:c72235e68f52 21 {
Experiment626 0:c72235e68f52 22 LED[x] = 1; // turn on
Experiment626 0:c72235e68f52 23 wait(.2); // delay
Experiment626 0:c72235e68f52 24
Experiment626 0:c72235e68f52 25 LED[x] = 0; // turn off
Experiment626 0:c72235e68f52 26 wait(delayTime); // delay
Experiment626 0:c72235e68f52 27 }
Experiment626 0:c72235e68f52 28
Experiment626 0:c72235e68f52 29 for(int x = 0; x < 7; x++)
Experiment626 0:c72235e68f52 30 {
Experiment626 0:c72235e68f52 31 LED[x] = 1; // turn on
Experiment626 0:c72235e68f52 32 wait(delayTime); // delay
Experiment626 0:c72235e68f52 33 }
Experiment626 0:c72235e68f52 34 for(int x = 6; x >= 0; x--)
Experiment626 0:c72235e68f52 35 {
Experiment626 0:c72235e68f52 36 LED[x] = 0; // turn off
Experiment626 0:c72235e68f52 37 wait(delayTime); // delay
Experiment626 0:c72235e68f52 38 }
Experiment626 0:c72235e68f52 39
Experiment626 0:c72235e68f52 40
Experiment626 0:c72235e68f52 41 }
Experiment626 0:c72235e68f52 42 }