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
Diff: src/LEDControl.cpp
- Revision:
- 10:99392075e1d0
- Child:
- 17:4d0e180cde20
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/LEDControl.cpp Mon Oct 19 19:57:15 2015 +0000
@@ -0,0 +1,21 @@
+#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
+ }
+
+}
\ No newline at end of file
