Panusorn Chinsakuljaroen
/
BTF411
Bluetooth for f411re reciever
Revision 0:75e3c6b099a6, committed 2018-12-04
- Comitter:
- sunninety1
- Date:
- Tue Dec 04 20:23:30 2018 +0000
- Commit message:
- Bluetooth for f411re;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 75e3c6b099a6 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Dec 04 20:23:30 2018 +0000 @@ -0,0 +1,40 @@ +#include "mbed.h" +#include <string> +#include <stdio.h> +#include <cstdlib> + +Serial pc(USBTX, USBRX); +Serial serial(D8,D2); +char data[50]; +string dat[4],dat1,dat2,dat3,dat4; +float num[4],numx; +int i; +const char * d; + +int main() { + pc.baud(115200); + i=0; + while(1) { + if(serial.readable() ) { + + serial.scanf("%50s", data); + dat[i]=data; + num[i] = atof(data); + pc.printf("%s \r\n",data); + pc.printf("%s \n",dat[0]); + pc.printf("---------------\n"); + i=i+1; + if(i>3){i=0;} + +/* + dat1=dat2; + dat2=dat3; + dat3=data; + serial.scanf("%50s", data); + d=dat1.c_str(); + numx=atof(d); + pc.printf("%s \r\n", d); +*/ + } + } +} \ No newline at end of file
diff -r 000000000000 -r 75e3c6b099a6 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Dec 04 20:23:30 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc \ No newline at end of file