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.
Dependents: noderedcolourpicker
node_red_parse.cpp
00001 #include "mbed.h" 00002 00003 00004 float led[5]; 00005 00006 float* stringparsing(char* buffer) 00007 { 00008 00009 char * pch; 00010 pch = strtok (buffer,",\""); 00011 // printf("%s\n\r",pch); 00012 int i = 0; 00013 while (pch != NULL) 00014 { 00015 // printf ("Inside function %s\n\r",pch); 00016 led[i] = atoi(pch); 00017 pch = strtok (NULL, ",\""); 00018 i++; 00019 } 00020 led[0] = 1-(led[0]/255.0); 00021 led[1] = 1-(led[1]/255.0); 00022 led[2] = 1-(led[2]/255.0); 00023 // pc.printf("red %f\n\r",led[0]); 00024 return led; 00025 00026 }
Generated on Fri Jul 15 2022 21:16:40 by
1.7.2