![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
A blinky variation for the mBuino with a bunch of different blink modes, deep-sleeping between iterations.
Dependencies: Crypto RNG mbed WakeUp
Fork of mBuinoBlinky by
mBuino blinky experiments.
main.cpp@1:47c61bf9c81e, 2014-09-04 (annotated)
- Committer:
- mikewebkist
- Date:
- Thu Sep 04 11:20:33 2014 +0000
- Revision:
- 1:47c61bf9c81e
- Parent:
- 0:aa0e1ad88af5
- Child:
- 2:fd6008aa85cd
slowing bouncy
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Experiment626 | 0:aa0e1ad88af5 | 1 | #include "mbed.h" |
Experiment626 | 0:aa0e1ad88af5 | 2 | |
Experiment626 | 0:aa0e1ad88af5 | 3 | DigitalOut LED[] = {(P0_7), (P0_8), (P0_2), (P0_20), (P1_19), (P0_17), (P0_23)};// declare 7 LEDs |
Experiment626 | 0:aa0e1ad88af5 | 4 | |
Experiment626 | 0:aa0e1ad88af5 | 5 | float delayTime = .05; |
Experiment626 | 0:aa0e1ad88af5 | 6 | |
Experiment626 | 0:aa0e1ad88af5 | 7 | int main() |
Experiment626 | 0:aa0e1ad88af5 | 8 | { |
Experiment626 | 0:aa0e1ad88af5 | 9 | while(1) |
Experiment626 | 0:aa0e1ad88af5 | 10 | { |
mikewebkist | 1:47c61bf9c81e | 11 | if(delayTime > 0.5) |
Experiment626 | 0:aa0e1ad88af5 | 12 | { |
mikewebkist | 1:47c61bf9c81e | 13 | delayTime = 0.05; |
Experiment626 | 0:aa0e1ad88af5 | 14 | } |
mikewebkist | 1:47c61bf9c81e | 15 | for(int x=0; x<7; x++) |
Experiment626 | 0:aa0e1ad88af5 | 16 | { |
mikewebkist | 1:47c61bf9c81e | 17 | LED[x] = 1; |
mikewebkist | 1:47c61bf9c81e | 18 | wait(delayTime); |
mikewebkist | 1:47c61bf9c81e | 19 | LED[x] = 0; |
mikewebkist | 1:47c61bf9c81e | 20 | //wait(delayTime); |
Experiment626 | 0:aa0e1ad88af5 | 21 | } |
mikewebkist | 1:47c61bf9c81e | 22 | for(int x=5; x>0; x--) |
Experiment626 | 0:aa0e1ad88af5 | 23 | { |
mikewebkist | 1:47c61bf9c81e | 24 | LED[x] = 1; |
mikewebkist | 1:47c61bf9c81e | 25 | wait(delayTime); |
mikewebkist | 1:47c61bf9c81e | 26 | LED[x] = 0; |
mikewebkist | 1:47c61bf9c81e | 27 | //wait(delayTime); |
Experiment626 | 0:aa0e1ad88af5 | 28 | } |
Experiment626 | 0:aa0e1ad88af5 | 29 | |
mikewebkist | 1:47c61bf9c81e | 30 | delayTime = delayTime * 1.5; |
Experiment626 | 0:aa0e1ad88af5 | 31 | } |
Experiment626 | 0:aa0e1ad88af5 | 32 | } |