servo:ADC

Dependencies:   mbed Servo TextLCD

Files at this revision

API Documentation at this revision

Comitter:
20172573073
Date:
Wed Jun 10 18:14:10 2020 +0000
Commit message:
programasazo farith

Changed in this revision

Servo.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
diff -r 000000000000 -r 1c10094f5bbb Servo.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Wed Jun 10 18:14:10 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/simon/code/Servo/#36b69a7ced07
diff -r 000000000000 -r 1c10094f5bbb TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Wed Jun 10 18:14:10 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/simon/code/TextLCD/#308d188a2d3a
diff -r 000000000000 -r 1c10094f5bbb main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jun 10 18:14:10 2020 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+#include "TextLCD.h"
+#include "Servo.h"
+TextLCD lcd(D0,D1,D2,D3,D4,D5, TextLCD::LCD16x2 );
+AnalogIn ain(A0);
+Servo led(PTD5);
+//PwmOut led(PB_0);
+float p;8
+
+int main()
+{
+    led.calibrate(0.0015,180);
+    
+    while(1) {
+        lcd.cls();
+        p=ain.read();
+        lcd.printf("porcen: %1.4f",p);
+        if(p<0.5) {
+            for(int i=0; i<100; i++) {
+                led = i/100.0;
+                wait(0.01);
+            }
+        } else {
+            for(int i=100; i>0; i--) {
+                led = i/100.0;
+                wait(0.01);
+            }
+        }
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 1c10094f5bbb mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jun 10 18:14:10 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file