PWM controlado con touch de la FL25Z

Dependencies:   TSI TextLCD-modificada mbed

Files at this revision

API Documentation at this revision

Comitter:
salondonog
Date:
Fri Dec 13 17:05:13 2013 +0000
Parent:
0:c5c53d980f96
Commit message:
PWM con touch

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r c5c53d980f96 -r 8d8ab2b89420 main.cpp
--- a/main.cpp	Thu Dec 05 21:08:22 2013 +0000
+++ b/main.cpp	Fri Dec 13 17:05:13 2013 +0000
@@ -8,7 +8,8 @@
     
 int main(void) {
 
-    PwmOut pwm(LED2);
+    PwmOut pwm(PTA5);
+    PwmOut led(LED2);
     TSISensor tsi;
     pwm.pulsewidth(dutty);
     pwm.period_ms(T);
@@ -16,6 +17,7 @@
     while (true) {
          if(tsi.readPercentage()!=0){
             pwm = 1.0 - tsi.readPercentage();
+            led = 1.0 - tsi.readPercentage();
             lcd.cls();
             lcd.printf("PWM=%g",tsi.readPercentage());
         }