AirsoftTimer software based on mbed
Dependencies: mbed TextLCD keypad
board/Leds.h@27:f29805113454, 2017-02-09 (annotated)
- Committer:
- sillevl
- Date:
- Thu Feb 09 12:28:56 2017 +0000
- Revision:
- 27:f29805113454
- Parent:
- 11:50572814f73e
ARCHIVE WIP, not working (crashes, cause unknown)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sillevl | 4:2c91c9eccf3a | 1 | #ifndef LEDS_H |
sillevl | 4:2c91c9eccf3a | 2 | #define LEDS_H |
sillevl | 4:2c91c9eccf3a | 3 | |
sillevl | 4:2c91c9eccf3a | 4 | #include "mbed.h" |
sillevl | 4:2c91c9eccf3a | 5 | |
sillevl | 4:2c91c9eccf3a | 6 | struct LedPins{ |
sillevl | 4:2c91c9eccf3a | 7 | PinName left; |
sillevl | 5:be598835bab0 | 8 | PinName right; |
sillevl | 4:2c91c9eccf3a | 9 | }; |
sillevl | 4:2c91c9eccf3a | 10 | |
sillevl | 11:50572814f73e | 11 | |
sillevl | 11:50572814f73e | 12 | |
sillevl | 4:2c91c9eccf3a | 13 | class Leds{ |
sillevl | 4:2c91c9eccf3a | 14 | |
sillevl | 4:2c91c9eccf3a | 15 | public: |
sillevl | 11:50572814f73e | 16 | enum LedName {LEFT = 0, RIGHT = 1, ALL = 2}; |
sillevl | 4:2c91c9eccf3a | 17 | Leds(PinName leftPin, PinName rightPin); |
sillevl | 11:50572814f73e | 18 | void on(Leds::LedName ledname); |
sillevl | 11:50572814f73e | 19 | void off(Leds::LedName ledname); |
sillevl | 11:50572814f73e | 20 | |
sillevl | 11:50572814f73e | 21 | private: |
sillevl | 11:50572814f73e | 22 | DigitalOut leftLed; |
sillevl | 11:50572814f73e | 23 | DigitalOut rightLed; |
sillevl | 4:2c91c9eccf3a | 24 | }; |
sillevl | 4:2c91c9eccf3a | 25 | #endif |