Rosario Schiano Lo Moriello
/
Example11AccelerometerSimulator
Accelerometer simulator
Diff: main.cpp
- Revision:
- 0:8ef83d7dc88d
- Child:
- 1:a31564d0b86c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 12 15:24:01 2020 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" + +Serial pc(PA_2,PA_3,115200); +char data; +int dato1 = 12345; +float dato2 = 1.2345e-21; + +int main(){ + pc.printf("Hello world!!!\r\n"); + pc.putc('T'); + pc.putc('h'); + pc.putc('i'); + pc.putc('s'); + pc.putc(' '); + pc.putc('i'); + pc.putc('s'); + pc.putc(' '); + pc.putc('p'); + pc.putc('u'); + pc.putc('t'); + pc.putc('c'); + pc.putc('\r'); + pc.putc('\n'); + pc.printf("The first value is %d and the second value is %e\r\n",dato1,dato2); + while(1){ + data=pc.getc(); + pc.putc(data); + if(data=='\r') + pc.putc('\n'); + } +} \ No newline at end of file