LAB LAB / Mbed 2 deprecated PWM_LCD

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
laboratorio
Date:
Sat May 25 11:43:31 2013 +0000
Commit message:
ADC converter to PWM and show in LCD

Changed in this revision

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
diff -r 000000000000 -r dc9390e62d46 TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Sat May 25 11:43:31 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#e4cb7ddee0d3
diff -r 000000000000 -r dc9390e62d46 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat May 25 11:43:31 2013 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+TextLCD lcd(p5, p6, p7, p8, p9, p10); // rs, e, d4-d7
+ 
+AnalogIn P1(p15);
+PwmOut led(LED1);
+PwmOut FM(p21);
+
+float Px;
+int PWM;
+
+int main() {
+    
+    led.period_ms (150);
+         
+    while(1) {
+    
+        Px = P1.read();
+                       
+            if(Px < 0.1){
+            Px = 0.1;
+            }
+            if(Px > 0.9){
+            Px = 0.9;
+            }
+        
+        PWM = Px*100;
+        led = Px;
+        FM = Px; 
+        Px = Px * 3.3;     
+        lcd.printf("S_FMBM = %2d PWM\n",PWM);
+        lcd.printf("V15 = %2.2f V\n",Px);
+    }
+}
+ 
+ 
diff -r 000000000000 -r dc9390e62d46 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat May 25 11:43:31 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17
\ No newline at end of file