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.
Dependencies: mbed
Diff: Blinking.cpp
- Revision:
- 1:9929cc08730b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Blinking.cpp Fri Nov 15 14:00:57 2019 +0000
@@ -0,0 +1,32 @@
+#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;
+ }
+ }
+}