![](/media/cache/group/arm_mbed.PNG.50x50_q85.png)
LED Demo for Tech Con 2014
Dependencies: EthernetInterface PololuLedStripx mbed-rtos mbed nanoservice_client_1_12_X
Fork of LPC1768_LWM2M_Client by
Diff: main.cpp
- Revision:
- 3:e3aa908cbb51
- Parent:
- 2:4166c3e5b321
- Child:
- 4:71b211dbe14c
--- 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} ;