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 LM75B mbed-rtos mbed
Led.cpp
- Committer:
- RobinMechele
- Date:
- 2018-03-16
- Revision:
- 4:7906049f6cca
- Parent:
- 3:fbf3c92f10ee
File content as of revision 4:7906049f6cca:
#include "led.h"
PwmOut red(p23);
PwmOut green(p24);
PwmOut blue(p25);
Led::Led()
{
red=1.0;
green=1.0;
blue=1.0;
}
int Led::setColor(char* color)
{
int i = 0;
if(strcmp(color,"RED")==0){
red=0.0; green=1.0; blue=1.0;
}
else if(strcmp(color,"GREEN")==0){
red=1.0; green=0.0; blue=1.0;
}
else if(strcmp(color,"BLUE")==0){
red=1.0; green=1.0; blue=0.0;
}
else if(strcmp(color,"ORANGE")==0){
red=0; green=0.33; blue=1;
}
else if(strcmp(color,"PURPLE")==0){
red=0.2; green=1; blue=0;
}
else if(strcmp(color,"WHITE")==0){
red=0; green=0; blue=0;
}
else{
i = 1;
}
return i;
}