Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: DORA_Actuator_Control.cpp
- Revision:
- 2:553cc8c4474f
- Child:
- 3:99f8c29cbac7
--- /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);
+ }
+
+}