![](/media/cache/profiles/9bd5ee6fe55aaeb673025dbcb8f939c1.50x50_q85.jpg)
Xmas tree serial LED blinking example code
Fork of JBB_SerialLED_test by
main.cpp@0:57df396a2de8, 2014-05-12 (annotated)
- Committer:
- jksoft
- Date:
- Mon May 12 11:01:44 2014 +0000
- Revision:
- 0:57df396a2de8
- Child:
- 1:832ea8c566a8
First edition
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:57df396a2de8 | 1 | /** |
jksoft | 0:57df396a2de8 | 2 | * Jksoft Blue mbed Board |
jksoft | 0:57df396a2de8 | 3 | * |
jksoft | 0:57df396a2de8 | 4 | * Serial LED test program |
jksoft | 0:57df396a2de8 | 5 | * |
jksoft | 0:57df396a2de8 | 6 | * Copyright (C) 2014 Junichi Katsu (JKSOFT) |
jksoft | 0:57df396a2de8 | 7 | */ |
jksoft | 0:57df396a2de8 | 8 | #include "mbed.h" |
jksoft | 0:57df396a2de8 | 9 | #include "LEDStrip.h" |
jksoft | 0:57df396a2de8 | 10 | |
jksoft | 0:57df396a2de8 | 11 | |
jksoft | 0:57df396a2de8 | 12 | int main() { |
jksoft | 0:57df396a2de8 | 13 | tapeInit(0, 2); // freq( 0:default ) , SerialLED num |
jksoft | 0:57df396a2de8 | 14 | |
jksoft | 0:57df396a2de8 | 15 | while(1) |
jksoft | 0:57df396a2de8 | 16 | { |
jksoft | 0:57df396a2de8 | 17 | for( int i=0 ; i < 256 ; i++ ) |
jksoft | 0:57df396a2de8 | 18 | { |
jksoft | 0:57df396a2de8 | 19 | tapeSet(0,i,0,0); // LED No , Red , Green , Blue |
jksoft | 0:57df396a2de8 | 20 | tapeSet(1,0,i,0); // LED No , Red , Green , Blue |
jksoft | 0:57df396a2de8 | 21 | tapeSend(); // Send to LED |
jksoft | 0:57df396a2de8 | 22 | wait_ms(20); |
jksoft | 0:57df396a2de8 | 23 | } |
jksoft | 0:57df396a2de8 | 24 | for( int i=255 ; i > 0 ; i-- ) |
jksoft | 0:57df396a2de8 | 25 | { |
jksoft | 0:57df396a2de8 | 26 | tapeSet(0,i,0,0); // LED No , Red , Green , Blue |
jksoft | 0:57df396a2de8 | 27 | tapeSet(1,0,i,0); // LED No , Red , Green , Blue |
jksoft | 0:57df396a2de8 | 28 | tapeSend(); // Send to led |
jksoft | 0:57df396a2de8 | 29 | wait_ms(20); |
jksoft | 0:57df396a2de8 | 30 | } |
jksoft | 0:57df396a2de8 | 31 | } |
jksoft | 0:57df396a2de8 | 32 | } |