Demonstrates that Nucleo represents divide by zero result as inf, not an error.
Fork of ArrayLimits by
Diff: main.cpp
- Revision:
- 0:2f9e67d4c561
- Child:
- 1:a000e0121191
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue May 16 20:32:12 2017 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" + +//------------------------------------ +// Tera Term configurations +// Terminal - New-line, Receive LF, Transmit LF +// Serial port - Data 8 bit, Parity none, Stop 1 bit data, Flow control none. +// Baud as specified below. +//------------------------------------ + +// Serial pc(SERIAL_TX, SERIAL_RX, 921600); // Highest Tera Term speed - works. +Serial pc(USBTX, USBRX, 115200); // Highest common speed - works. +// Serial pc(USBTX, USBRX); // Default 9600 baud, alternate pin names - works. + +DigitalOut myled(LED1); + +int main() +{ + int i = 1; + pc.printf("Hello World !\n"); + while(1) { + wait(1); + pc.printf("This program runs since %d seconds.\n", i++); + myled = !myled; + } +} \ No newline at end of file