Jelle Raes / Mbed 2 deprecated Projec_1_projectlab

Dependencies:   EthernetInterface LM75B mbed-rtos mbed

Fork of communication by Jelle Raes

led.cpp

Committer:
JelleRaes
Date:
2018-03-13
Revision:
0:52e944ca21ea
Child:
2:067142778937

File content as of revision 0:52e944ca21ea:

#include "mbed.h"
#include <string.h>
#include "led.h"

Serial pc3(USBTX, USBRX);
led::led(void)
{
    count =4;
    colors[0].name="red";
    colors[0].redValue = 0.0;
    colors[0].greenValue =1.0;
    colors[0].blueValue =1.0;
    
    colors[1].name="green";
    colors[1].redValue = 1.0;
    colors[1].greenValue =0.0;
    colors[1].blueValue =1.0;
    
    colors[2].name="blue";
    colors[2].redValue = 1.0;
    colors[2].greenValue =1.0;
    colors[2].blueValue =0.0;
    
    colors[3].name="black";
    colors[3].redValue = 1.0;
    colors[3].greenValue =1.0;
    colors[3].blueValue =1.0;
}

                
led::COLOR led::getCOLOR(char *n){
    led::COLOR temp;
    for(int i=0;i<count;i++){
            if(strcmp(colors[i].name,n) ==0)
            temp=colors[i];}
    return temp;
}