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.
main.cpp@0:48db693b0f9e, 2017-01-25 (annotated)
- Committer:
- jacobjohnson
- Date:
- Wed Jan 25 18:29:02 2017 +0000
- Revision:
- 0:48db693b0f9e
Grove Chainable LED example code for ON Semiconductor NCS36510;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jacobjohnson | 0:48db693b0f9e | 1 | #include "mbed.h" |
jacobjohnson | 0:48db693b0f9e | 2 | #include "ChainableLED.h" |
jacobjohnson | 0:48db693b0f9e | 3 | |
jacobjohnson | 0:48db693b0f9e | 4 | // ChainableLED(clk, data, number_of_leds) |
jacobjohnson | 0:48db693b0f9e | 5 | ChainableLED color_led(D0, D1, 1); |
jacobjohnson | 0:48db693b0f9e | 6 | |
jacobjohnson | 0:48db693b0f9e | 7 | int main() { |
jacobjohnson | 0:48db693b0f9e | 8 | uint8_t value = 0; |
jacobjohnson | 0:48db693b0f9e | 9 | |
jacobjohnson | 0:48db693b0f9e | 10 | while(1) { |
jacobjohnson | 0:48db693b0f9e | 11 | value++; |
jacobjohnson | 0:48db693b0f9e | 12 | // ChainableLED.setColorRGB(index_of_led, red, green, blue) |
jacobjohnson | 0:48db693b0f9e | 13 | color_led.setColorRGB(0, value, 255 - value, value + 80); |
jacobjohnson | 0:48db693b0f9e | 14 | wait_ms(10); |
jacobjohnson | 0:48db693b0f9e | 15 | } |
jacobjohnson | 0:48db693b0f9e | 16 | } |