Domenico Vitale / Mbed 2 deprecated PWM

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
domemort
Date:
Wed Nov 03 15:31:59 2021 +0000
Commit message:
-

Changed in this revision

PWM.cpp Show annotated file Show diff for this revision Revisions of this file
PWM_with_led.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/PWM.cpp	Wed Nov 03 15:31:59 2021 +0000
@@ -0,0 +1,7 @@
+#include "mbed.h"
+PwmOut  PWM(D6);
+
+int main(){
+     PWM.period(0.01);
+     PWM=0.6;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PWM_with_led.cpp	Wed Nov 03 15:31:59 2021 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+Serial pc(USBTX, USBRX);
+PwmOut  LED(D6);
+DigitalIn bottone(USER_BUTTON);
+float ADCdata;
+
+int main(){
+     pc.printf("ADC Data Values...\n\r");
+     while(1){
+     LED.period(1);
+     if (bottone==0){
+     LED=0.3;
+     } else LED=0.7;
+       ADCdata=LED*3.3f;
+       wait(0.5);
+       pc.printf("%1.3f\n\r", ADCdata);
+         if(ADCdata<1.65f){
+            LED=1;}
+        else LED=0;
+     }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Nov 03 15:31:59 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file