Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of RGBLED by
main.cpp@1:a43483907ce0, 2015-01-29 (annotated)
- Committer:
- bohocode
- Date:
- Thu Jan 29 08:42:26 2015 +0000
- Revision:
- 1:a43483907ce0
- Parent:
- 0:7c0b6a649748
Added yellow, cyan and magenta.
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); |
bohocode | 1:a43483907ce0 | 12 | rgb.set(yellow); |
bohocode | 1:a43483907ce0 | 13 | wait(1); |
rcflyair | 0:7c0b6a649748 | 14 | rgb.set(green); |
rcflyair | 0:7c0b6a649748 | 15 | wait(1); |
bohocode | 1:a43483907ce0 | 16 | rgb.set(cyan); |
bohocode | 1:a43483907ce0 | 17 | wait(1); |
rcflyair | 0:7c0b6a649748 | 18 | rgb.set(blue); |
rcflyair | 0:7c0b6a649748 | 19 | wait(1); |
bohocode | 1:a43483907ce0 | 20 | rgb.set(magenta); |
bohocode | 1:a43483907ce0 | 21 | wait(1); |
rcflyair | 0:7c0b6a649748 | 22 | } |
rcflyair | 0:7c0b6a649748 | 23 | } |