Refactoring Ironcup 2020
Dependencies: mbed mbed-rtos MotionSensor EthernetInterface
LED/LED.hpp@0:8f5db5085df7, 2020-09-21 (annotated)
- Committer:
- starling
- Date:
- Mon Sep 21 21:42:07 2020 +0000
- Revision:
- 0:8f5db5085df7
12 mar 2020
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
starling | 0:8f5db5085df7 | 1 | #ifndef __LED__ |
starling | 0:8f5db5085df7 | 2 | #define __LED__ |
starling | 0:8f5db5085df7 | 3 | |
starling | 0:8f5db5085df7 | 4 | #include "mbed.h" |
starling | 0:8f5db5085df7 | 5 | |
starling | 0:8f5db5085df7 | 6 | |
starling | 0:8f5db5085df7 | 7 | class LED { |
starling | 0:8f5db5085df7 | 8 | private: |
starling | 0:8f5db5085df7 | 9 | int RGB_LED_ON; //active Low |
starling | 0:8f5db5085df7 | 10 | int RGB_LED_OFF; //active Low |
starling | 0:8f5db5085df7 | 11 | int MAIN_RGB_LED_ON; //active HIGH |
starling | 0:8f5db5085df7 | 12 | int MAIN_RGB_LED_OFF; |
starling | 0:8f5db5085df7 | 13 | |
starling | 0:8f5db5085df7 | 14 | // Leds Objects |
starling | 0:8f5db5085df7 | 15 | DigitalOut red_led_main; |
starling | 0:8f5db5085df7 | 16 | DigitalOut green_led_main; |
starling | 0:8f5db5085df7 | 17 | DigitalOut blue_led_main; |
starling | 0:8f5db5085df7 | 18 | |
starling | 0:8f5db5085df7 | 19 | DigitalOut red_led_nxp; |
starling | 0:8f5db5085df7 | 20 | DigitalOut green_led_nxp; |
starling | 0:8f5db5085df7 | 21 | DigitalOut blue_led_nxp; |
starling | 0:8f5db5085df7 | 22 | |
starling | 0:8f5db5085df7 | 23 | |
starling | 0:8f5db5085df7 | 24 | public: |
starling | 0:8f5db5085df7 | 25 | enum{ |
starling | 0:8f5db5085df7 | 26 | BLACK, |
starling | 0:8f5db5085df7 | 27 | RED, |
starling | 0:8f5db5085df7 | 28 | GREEN, |
starling | 0:8f5db5085df7 | 29 | BLUE, |
starling | 0:8f5db5085df7 | 30 | WHITE, |
starling | 0:8f5db5085df7 | 31 | PURPLE, |
starling | 0:8f5db5085df7 | 32 | YELLOW, |
starling | 0:8f5db5085df7 | 33 | AQUA}; |
starling | 0:8f5db5085df7 | 34 | |
starling | 0:8f5db5085df7 | 35 | LED(PinName red_main, PinName green_main, PinName blue_main, |
starling | 0:8f5db5085df7 | 36 | PinName red_nxp, PinName green_nxp, PinName blue_nxp); |
starling | 0:8f5db5085df7 | 37 | |
starling | 0:8f5db5085df7 | 38 | void set_leds_color_nxp(int color); |
starling | 0:8f5db5085df7 | 39 | void turn_leds_off_nxp(); |
starling | 0:8f5db5085df7 | 40 | |
starling | 0:8f5db5085df7 | 41 | void set_leds_color_main(int color); |
starling | 0:8f5db5085df7 | 42 | void turn_leds_off_main(); |
starling | 0:8f5db5085df7 | 43 | |
starling | 0:8f5db5085df7 | 44 | |
starling | 0:8f5db5085df7 | 45 | }; |
starling | 0:8f5db5085df7 | 46 | #endif //__LED__ |