Ben X / Mbed 2 deprecated mbed_LED_brightness_PWM

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
khalish18
Date:
Tue Mar 26 10:38:54 2019 +0000
Commit message:
brighness

Changed in this revision

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/main.cpp	Tue Mar 26 10:38:54 2019 +0000
@@ -0,0 +1,14 @@
+/*Program Example 5.2: Uses analog input to control PWM duty cycle, fixed period
+                                                                            */
+#include "mbed.h"
+PwmOut PWM1(p21);
+AnalogIn Ain(p20);         //defines analog input on Pin 20
+
+int main() {
+  while(1) {
+    PWM1.period(Ain/1000 + 0.001);
+    PWM1=Ain;
+    wait(0.5);
+  }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Mar 26 10:38:54 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file