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.
Fork of Nucleo-mbed-os-example-blinky by
Diff: main.cpp
- Revision:
- 2:07a218c4cb20
- Parent:
- 1:860c7462805e
- Child:
- 3:a6caeb32839c
diff -r 860c7462805e -r 07a218c4cb20 main.cpp
--- a/main.cpp Wed Aug 17 18:01:51 2016 +0000
+++ b/main.cpp Wed Aug 17 18:10:55 2016 +0000
@@ -1,33 +1,14 @@
#include "mbed.h"
-DigitalOut led1(LED1);
-InterruptIn event(USER_BUTTON);
-Ticker ticker;
-Serial ser(USBTX, USBRX);
-
-void
-ButtonPressed(void)
-{
- led1 = !led1;
-}
-
-void
-AlarmHandler(void)
-{
- static int alarmCount;
- led1 = !led1;
-}
+PwmOut led(LED1);
int main()
-{
- ser.baud(230400);
- ser.printf("Hello, World\r\n");
-
- event.rise(&ButtonPressed);
- ticker.attach(&AlarmHandler, 1.5);
-
+{
while (true) {
- ;
+ led = led + 0.05f;
+ wait(0.1);
+ if (led >= 1.0f)
+ led = 0;
}
}
