LoRa node acquiring random float value and sending to LoRa Server - Working ok
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; }