RGB LED Class
Dependencies: mbed
Fork of RGBLED by
main.cpp@0:7c0b6a649748, 2014-06-09 (annotated)
- Committer:
- rcflyair
- Date:
- Mon Jun 09 14:17:39 2014 +0000
- Revision:
- 0:7c0b6a649748
First version non-library version without doxy
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rcflyair | 0:7c0b6a649748 | 1 | #include "mbed.h" |
rcflyair | 0:7c0b6a649748 | 2 | #include "rgbled.h" |
rcflyair | 0:7c0b6a649748 | 3 | |
rcflyair | 0:7c0b6a649748 | 4 | int main(void) |
rcflyair | 0:7c0b6a649748 | 5 | { |
rcflyair | 0:7c0b6a649748 | 6 | rgbled rgb(PTB22, PTE26, PTB21); // create rgb object with pin definitions for FRDM-K64F board |
rcflyair | 0:7c0b6a649748 | 7 | rgb.active(false); // set led output to active low |
rcflyair | 0:7c0b6a649748 | 8 | rgb.set(none); // set led output of all off |
rcflyair | 0:7c0b6a649748 | 9 | while(1){ |
rcflyair | 0:7c0b6a649748 | 10 | rgb.set(red); |
rcflyair | 0:7c0b6a649748 | 11 | wait(1); |
rcflyair | 0:7c0b6a649748 | 12 | rgb.set(green); |
rcflyair | 0:7c0b6a649748 | 13 | wait(1); |
rcflyair | 0:7c0b6a649748 | 14 | rgb.set(blue); |
rcflyair | 0:7c0b6a649748 | 15 | wait(1); |
rcflyair | 0:7c0b6a649748 | 16 | } |
rcflyair | 0:7c0b6a649748 | 17 | } |