Frederick Huang
/
ADXL345Test
ADXL345 Evaluation
main.cpp@0:51be560629b8, 2014-01-30 (annotated)
- Committer:
- screamer
- Date:
- Thu Jan 30 17:06:58 2014 +0000
- Revision:
- 0:51be560629b8
- Child:
- 2:0bc5af6c7ebf
initial release
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
screamer | 0:51be560629b8 | 1 | #include "mbed.h" |
screamer | 0:51be560629b8 | 2 | |
screamer | 0:51be560629b8 | 3 | DigitalOut red(D5); |
screamer | 0:51be560629b8 | 4 | DigitalOut blue(D8); |
screamer | 0:51be560629b8 | 5 | DigitalOut green(D9); |
screamer | 0:51be560629b8 | 6 | int i; |
screamer | 0:51be560629b8 | 7 | |
screamer | 0:51be560629b8 | 8 | int main() { |
screamer | 0:51be560629b8 | 9 | while(1) { |
screamer | 0:51be560629b8 | 10 | for (i=1; i<7; i++) { |
screamer | 0:51be560629b8 | 11 | red = i & 1; |
screamer | 0:51be560629b8 | 12 | blue = i & 2; |
screamer | 0:51be560629b8 | 13 | green = i & 4; |
screamer | 0:51be560629b8 | 14 | wait(0.2); |
screamer | 0:51be560629b8 | 15 | } |
screamer | 0:51be560629b8 | 16 | } |
screamer | 0:51be560629b8 | 17 | } |