imu for l432kc

Dependencies:   mbed

Committer:
sunninety1
Date:
Tue Dec 04 04:38:15 2018 +0000
Revision:
1:f8ed70330216
Parent:
0:25538f02f59a
Child:
2:01ca44dd3908
bluetooth patch 1.1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sunninety1 0:25538f02f59a 1
sunninety1 0:25538f02f59a 2
sunninety1 0:25538f02f59a 3 #include "mbed.h"
sunninety1 0:25538f02f59a 4
sunninety1 0:25538f02f59a 5 Serial serial(D8, D2);
sunninety1 0:25538f02f59a 6 InterruptIn userButton(USER_BUTTON);
sunninety1 0:25538f02f59a 7
sunninety1 0:25538f02f59a 8 void sendSerial(void) {
sunninety1 0:25538f02f59a 9 if(serial.writeable()) {
sunninety1 1:f8ed70330216 10 serial.printf("Amigo!_This_is_Sunnylego!%.1f ",123.5);
sunninety1 0:25538f02f59a 11 wait_ms(500); // lag to debounce the button
sunninety1 0:25538f02f59a 12 }
sunninety1 0:25538f02f59a 13 }
sunninety1 0:25538f02f59a 14
sunninety1 0:25538f02f59a 15 int main(void) {
sunninety1 0:25538f02f59a 16 userButton.fall(callback(sendSerial));
sunninety1 0:25538f02f59a 17
sunninety1 0:25538f02f59a 18 while(1) {}
sunninety1 0:25538f02f59a 19 }
sunninety1 0:25538f02f59a 20
sunninety1 0:25538f02f59a 21 /*
sunninety1 0:25538f02f59a 22 #include "mbed.h"
sunninety1 0:25538f02f59a 23
sunninety1 0:25538f02f59a 24 Serial pc(USBTX, USBRX);
sunninety1 0:25538f02f59a 25 Serial serial(PA_9,PA_10);
sunninety1 1:f8ed70330216 26 char data[30];
sunninety1 0:25538f02f59a 27
sunninety1 0:25538f02f59a 28 int main() {
sunninety1 0:25538f02f59a 29 while(1) {
sunninety1 0:25538f02f59a 30 if(serial.readable() ) {
sunninety1 1:f8ed70330216 31 serial.scanf("%30s", data);
sunninety1 0:25538f02f59a 32 pc.printf("Serial data: %s\r\n", data);
sunninety1 0:25538f02f59a 33 }
sunninety1 0:25538f02f59a 34 }
sunninety1 0:25538f02f59a 35 }*/