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.
Revision 99:0e85871f676a, committed 2017-11-18
- Comitter:
- Helmut Tschemernjak
- Date:
- Sat Nov 18 13:55:54 2017 +0100
- Parent:
- 98:1e741f2b3eda
- Child:
- 100:c80d1416bdf6
- Commit message:
- Added correct support for ESP32 Serial, ESP32 ports
Changed in this revision
| Arduino-mbed-APIs/examples/TimerTest/TimerTest.ino | Show annotated file Show diff for this revision Revisions of this file |
--- a/Arduino-mbed-APIs/examples/TimerTest/TimerTest.ino Sat Nov 18 13:54:38 2017 +0100
+++ b/Arduino-mbed-APIs/examples/TimerTest/TimerTest.ino Sat Nov 18 13:55:54 2017 +0100
@@ -7,9 +7,15 @@
void TestTimeoutFunc1m(void);
void SwitchInput(void);
+#ifdef ARDUINO_ARCH_ESP32
+#define SW0 0
+#define LED 2
+#define MYSERIAL Serial
+#else
#define SW0 3 // switch needs pullup
#define LED LED_BUILTIN
#define MYSERIAL Serial
+#endif
DigitalOut led(LED);
InterruptIn intr(SW0);
@@ -20,7 +26,7 @@
void setup() {
MYSERIAL.begin(230400);
- InitSerial(&MYSERIAL);
+ InitSerial(&MYSERIAL, 5000, &led, true);
ser->println("TimerTest");
@@ -34,7 +40,7 @@
}
void loop() {
- led = !led;
+ // led = !led;
sleep(); // or deepsleep()
}