Panusorn Chinsakuljaroen
/
BTL432kc
imu for l432kc
test.cpp
- Committer:
- sunninety1
- Date:
- 2018-12-04
- Revision:
- 0:25538f02f59a
- Child:
- 1:f8ed70330216
File content as of revision 0:25538f02f59a:
#include "mbed.h" Serial serial(D8, D2); InterruptIn userButton(USER_BUTTON); void sendSerial(void) { if(serial.writeable()) { serial.printf("%.2f ",123.5); wait_ms(500); // lag to debounce the button } } int main(void) { userButton.fall(callback(sendSerial)); while(1) {} } /* #include "mbed.h" Serial pc(USBTX, USBRX); Serial serial(PA_9,PA_10); char data[10]; int main() { while(1) { if(serial.readable() ) { serial.scanf("%9s", data); pc.printf("Serial data: %s\r\n", data); } } }*/