
Cylce through colors of a common cathode RGB LED by using BusOut object class
main.cpp@0:ee49cf1985be, 2021-09-22 (annotated)
- Committer:
- cspista
- Date:
- Wed Sep 22 13:24:34 2021 +0000
- Revision:
- 0:ee49cf1985be
Final version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cspista | 0:ee49cf1985be | 1 | #include "mbed.h" |
cspista | 0:ee49cf1985be | 2 | |
cspista | 0:ee49cf1985be | 3 | BusOut rgbled(D5, D6, D7); // RGB outputs |
cspista | 0:ee49cf1985be | 4 | |
cspista | 0:ee49cf1985be | 5 | int main() |
cspista | 0:ee49cf1985be | 6 | { |
cspista | 0:ee49cf1985be | 7 | while (true) { |
cspista | 0:ee49cf1985be | 8 | for(int i=0; i<8; i++) { |
cspista | 0:ee49cf1985be | 9 | rgbled = i; |
cspista | 0:ee49cf1985be | 10 | wait(2.0); |
cspista | 0:ee49cf1985be | 11 | } |
cspista | 0:ee49cf1985be | 12 | } |
cspista | 0:ee49cf1985be | 13 | } |