![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
RGB LED chika chika
Fork of mbed_LED_chika by
main.cpp@9:5ba1eff3500b, 2015-07-22 (annotated)
- Committer:
- thursday1024
- Date:
- Wed Jul 22 07:54:58 2015 +0000
- Revision:
- 9:5ba1eff3500b
- Parent:
- 8:c87c95d37988
RGB LED chika chika
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thursday1024 | 9:5ba1eff3500b | 1 | // mbed_LED_chika main.cpp |
dan | 0:7dec7e9ac085 | 2 | #include "mbed.h" |
dan | 0:7dec7e9ac085 | 3 | |
thursday1024 | 8:c87c95d37988 | 4 | DigitalOut myled1(LED1); |
thursday1024 | 9:5ba1eff3500b | 5 | DigitalIn mysw1(PTA4); // push:0 open:1 |
dan | 0:7dec7e9ac085 | 6 | |
dan | 0:7dec7e9ac085 | 7 | int main() { |
dan | 0:7dec7e9ac085 | 8 | while(1) { |
thursday1024 | 9:5ba1eff3500b | 9 | myled1 = mysw1; // turn off |
thursday1024 | 8:c87c95d37988 | 10 | wait(0.9); |
thursday1024 | 9:5ba1eff3500b | 11 | myled1 = 0; // turn on |
thursday1024 | 8:c87c95d37988 | 12 | wait(0.1); |
stevep | 4:81cea7a352b0 | 13 | } |
dan | 0:7dec7e9ac085 | 14 | } |
thursday1024 | 9:5ba1eff3500b | 15 | |
thursday1024 | 9:5ba1eff3500b | 16 | // memo |
thursday1024 | 9:5ba1eff3500b | 17 | // R-LED -> LED1; |
thursday1024 | 9:5ba1eff3500b | 18 | // G-LED -> LED2; |
thursday1024 | 9:5ba1eff3500b | 19 | // B-LED -> LED3; |
thursday1024 | 9:5ba1eff3500b | 20 | // sw3 -> PTA4 |
thursday1024 | 9:5ba1eff3500b | 21 | // sw2 -> PTC6; |