DORA prova 1
Revision 2:553cc8c4474f, committed 2021-10-27
- Comitter:
- pinofal
- Date:
- Wed Oct 27 19:03:59 2021 +0000
- Parent:
- 1:9929cc08730b
- Child:
- 3:99f8c29cbac7
- Commit message:
- DORA prova 1
Changed in this revision
--- a/Blinking.cpp Fri Nov 15 14:00:57 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#include "mbed.h"
-// genera un oggetto serial collegato al PC
-Serial pc(USBTX, USBRX);
-
-// genera un oggetto DigitalOut collegato al Led
-DigitalIn myButton(USER_BUTTON);
-DigitalOut myLed(LED1);
-
-//DigitalIn myButton(PA_0); // verde
-int main()
-{
- // configura velocità della comunicazione seriale su USB-VirtualCom e invia messaggio di benvenuto
- pc.baud(921600); //921600 bps
-
- while(true)
- {
- myLed = 0;
- wait(1);
- myLed = 1;
-
- if(myButton==0)
- {
- pc.printf("IN = 0\r\n");
- myLed = 1;
- }
- else
- {
- pc.printf("IN = 1\r\n");
- myLed = 0;
- }
- }
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/DORA_Actuator_Control.cpp Wed Oct 27 19:03:59 2021 +0000
@@ -0,0 +1,38 @@
+#include "mbed.h"
+
+// genera un oggetto serial collegato al PC
+//Serial pc(USBTX, USBRX);
+
+// output per pilotare attuatore DORA con while(true) e wait_us
+DigitalOut OutPWMScafesso(PA_10);
+
+// Output per pilotaggio attuatore DORA con funzioni PWM
+PwmOut OutPWM (PB_8);
+
+// User Button, LED
+DigitalIn myOnBoardButton(USER_BUTTON); // pulsante Blu sulla scheda. Associato a PC_13
+DigitalOut myOnBoardLed(LED2); // LED verde sulla scheda. Associato a PA_5
+
+
+//++++++++++++++++++
+// Ciclo principale
+//++++++++++++++++++
+int main()
+{
+ //pc.baud(921600); //921600 bps
+ //pc.printf("Welcome to DORA \r\n");
+ // inizializza il PWM
+ //OutPWM.period_us(1000); // periodo del PWM
+ //OutPWM.write(0.5); // inizializza duty cycle del PWM
+
+ while(true)
+ {
+ //myOnBoardLed = 1;
+ OutPWMScafesso=1;
+ wait_us(000);
+ //myOnBoardLed = 0;
+ OutPWMScafesso = 0;
+ wait_us(1000);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Wed Oct 27 19:03:59 2021 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#2fd0c5cfbd83fce62da6308f9d64c0ab64e1f0d6
--- a/mbed.bld Fri Nov 15 14:00:57 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file