Node-red colour picker serially

Dependencies:   mbed node-red_serial_parse

main.cpp

Committer:
rushabkarani
Date:
2017-03-30
Revision:
0:f6084e072350

File content as of revision 0:f6084e072350:

#include "mbed.h"

#include "node_red_parse.h"

PwmOut red(LED1); // pwmout pin defination for red led
PwmOut green(LED2); // pwmout pin defination for green led
PwmOut blue(LED3); // pwmout pin defination for blue led
Serial pc(USBTX,USBRX); //serial pin defination


float* led1;
int main() {
    //intially turning off all led
    red = 1; 
    green = 1;
    blue = 1;
    
    char buffer[25];
    while(1) {
        if(pc.readable())
        {
            pc.scanf("%s",&buffer);
            pc.printf("I got %s\n\r", buffer); 
            
            led1=stringparsing(buffer);            
            red = led1[0];
            green = led1[1];
            blue = led1[2];
        }
        
    }
}