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.
Dependencies: EthernetInterface PololuLedStripx mbed-rtos mbed nanoservice_client_1_12_X
Fork of LPC1768_LWM2M_Client by
Revision 3:e3aa908cbb51, committed 2014-09-28
- Comitter:
- michaeljkoster
- Date:
- Sun Sep 28 00:09:18 2014 +0000
- Parent:
- 2:4166c3e5b321
- Child:
- 4:71b211dbe14c
- Commit message:
- Working LED strip
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Sep 27 23:58:43 2014 +0000
+++ b/main.cpp Sun Sep 28 00:09:18 2014 +0000
@@ -124,23 +124,14 @@
{
static uint8_t red, green, blue, index ;
int color_int ;
-int num ;
- //pc.printf("set_led_color: %s\r\n", color_string);
- // convert string to uint8 tuple
- num = sscanf(color_string, "%X", &color_int);
- //pc.printf("color_int: %d %x\r\n", num, color_int);
+ sscanf(color_string, "%X", &color_int);
index = color_int & 255;
blue = color_int >> 8 & 255;
green = color_int >> 16 & 255;
red = color_int >> 24 & 255;
-
- //pc.printf("index: %x\r\n", index);
- //pc.printf("red: %x\r\n", red);
- //pc.printf("green: %x\r\n", green);
- //pc.printf("blue: %x\r\n", blue);
-
+
if(index > 0 and index <= LED_COUNT)
{
colors[index-1] = (rgb_color) {red,green,blue} ;
