BusOut_RGBLED: Usage example for the BusOut object class. Here the pins connected to the RGB LED are treated as one three-bit unit. The "7-i" bit inversion is required due to the negative logic of the common anode RGB LED (i.e. '0' = on, '1' = off). Platform: FRDM-KL25z board
Dependencies: mbed
Fork of busout_rgbled by
main.cpp
- Committer:
- icserny
- Date:
- 2015-10-13
- Revision:
- 0:9c63ab9c1882
File content as of revision 0:9c63ab9c1882:
/** BusOut_RGBLED * Usage example for the BusOut object class * Here the pins connected to the RGB LED are treated as * one three-bit unit. * The "7-i" bit inversion is required due to the negative logic * of the common anode RGB LED (i.e. '0' = on, '1' = off) * * Platform: FRDM-KL25z board */ #include "mbed.h" BusOut rgbled(LED_RED,LED_GREEN,LED_BLUE); int main() { while (true) { for(int i=0; i<8; i++) { rgbled = 7-i; wait(0.5); } } }