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: 4DGL-uLCD-SE mbed
src/LEDControl.cpp
- Committer:
- kevinrhyne
- Date:
- 2015-10-19
- Revision:
- 10:99392075e1d0
- Child:
- 17:4d0e180cde20
File content as of revision 10:99392075e1d0:
#include "mbed.h"
#include "RGBLed.h"
#include "LEDControl.h"
//LED CONTROL CLASS
RGBLed myRGBled1(p22,p21,p25); //RGB PWM pins
RGBLed myRGBled2(p24,p23,p25); //RGB PWM pins
void LEDControl::update(int x){
strength = x;
if( strength==0 ){
myRGBled1.write(1.0,0.0,0.0); //red
myRGBled2.write(1.0,0.0,0.0); //red
}
else if( strength != 0){
myRGBled1.write(0.0,1.0,0.0); //green
myRGBled2.write(0.0,1.0,0.0); //green
}
}
