PWM, ancho de pulso variable, periodo variable (lectura por puerto)

Dependencies:   TSI TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
avallejopo
Date:
Fri Nov 29 18:25:47 2013 +0000
Commit message:
PWM, ancho de pulso variable, periodo variable (lectura por puerto)

Changed in this revision

TSI.lib Show annotated file Show diff for this revision Revisions of this file
TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TSI.lib	Fri Nov 29 18:25:47 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/vsluiter/code/TSI/#4dc2f5a3a731
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Fri Nov 29 18:25:47 2013 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/avallejopo/code/TextLCD/#aba8ab3dde9d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Nov 29 18:25:47 2013 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+#include "TSISensor.h"
+#include "TextLCD.h"
+
+TextLCD lcd(PTB10, PTB11, PTE2, PTE3, PTE4, PTE5); // rs, e, d4-d7
+Timer t1;
+float anchop=0.5;
+float periodo=100;
+int main(void) {
+
+    PwmOut led(PTA5);
+    TSISensor tsi;
+    led.pulsewidth(anchop);
+    led.period_ms(periodo);
+    
+    while (true) {
+        if(tsi.readPercentage()!=0){
+            led = 1.0 - tsi.readPercentage();
+            lcd.cls();
+            lcd.printf("PWM=%g",tsi.readPercentage());
+        }        
+        wait(0.1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Nov 29 18:25:47 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file