V1
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:4a721db37680
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu May 14 15:51:47 2020 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" +#define PI 3.14f +Serial pc(SERIAL_TX, SERIAL_RX); +Ticker mesure; +bool f_mesure=0 ;// flag ticker +void t_mesure() +{ + f_mesure=1; +} + +DigitalOut led(LED1); + +int main() +{ + pc.baud(9600); + pc.printf("Hello World !\n"); + mesure.attach(&t_mesure,0.1); + int i = 0; + while(1) { + if(f_mesure) { + pc.printf("%f %f\r\n", sin(2*PI*i/100),cos(2*PI*i/100)); + i++; + f_mesure=0; + } + } +} \ No newline at end of file