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.
Dependents: DISCO-L072CZ-LRWAN1_LoRa_node EIoT_LoRa_node_1 EIoT_LoRa_node_2 EIoT_LoRa_node_3
Fork of SX1276GenericLib by
Diff: Arduino-mbed-APIs/examples/TimerTest/TimerTest.ino
- Revision:
- 75:7330dd86cdea
- Parent:
- 72:2a6c776b5e92
- Child:
- 99:0e85871f676a
--- a/Arduino-mbed-APIs/examples/TimerTest/TimerTest.ino Sun Jul 23 18:04:39 2017 +0200
+++ b/Arduino-mbed-APIs/examples/TimerTest/TimerTest.ino Wed Jul 26 15:18:35 2017 +0200
@@ -8,8 +8,10 @@
void SwitchInput(void);
#define SW0 3 // switch needs pullup
+#define LED LED_BUILTIN
+#define MYSERIAL Serial
-DigitalOut led(LED_BUILTIN);
+DigitalOut led(LED);
InterruptIn intr(SW0);
Timeout tp;
Timeout tp2;
@@ -17,9 +19,10 @@
Timeout tp4;
void setup() {
- Serial.begin(230400);
+ MYSERIAL.begin(230400);
+ InitSerial(&MYSERIAL);
- Serial.println("TimerTest");
+ ser->println("TimerTest");
tp.attach(callback(&TestTimeoutFunc), 1000);
tp2.attach(callback(&TestTimeoutFunc55), 5500);
@@ -41,21 +44,21 @@
void TestTimeoutFunc(void) {
tp.attach(callback(&TestTimeoutFunc), 1000);
led = !led;
- Serial.print(ms_getTicker(), DEC);
- Serial.println(" TestTimeoutFunc 1 sec");
+ ser->print(ms_getTicker(), DEC);
+ ser->println(" TestTimeoutFunc 1 sec");
}
void TestTimeoutFunc55(void) {
tp2.attach(callback(&TestTimeoutFunc55), 5500);
- Serial.print(ms_getTicker(), DEC);
- Serial.println(" TestTimeoutFunc 5.5 sec");
+ ser->print(ms_getTicker(), DEC);
+ ser->println(" TestTimeoutFunc 5.5 sec");
}
void TestTimeoutFunc10(void) {
tp3.attach(callback(&TestTimeoutFunc10), 10000);
- Serial.print(ms_getTicker(), DEC);
- Serial.println(" TestTimeoutFunc 10 sec");
+ ser->print(ms_getTicker(), DEC);
+ ser->println(" TestTimeoutFunc 10 sec");
}
@@ -64,7 +67,7 @@
}
void SwitchInput(void) {
- Serial.print(ms_getTicker(), DEC);
- Serial.println(" SwitchInput");
+ ser->print(ms_getTicker(), DEC);
+ ser->println(" SwitchInput");
led = !led;
}
