jason berry
/
mbed_bot
mbed_bot
Diff: main.cpp
- Revision:
- 1:dfc4375f3eb5
- Parent:
- 0:d44946656cbe
- Child:
- 2:1fd9d55f66e0
--- a/main.cpp Thu Feb 25 13:22:04 2021 +0000 +++ b/main.cpp Mon Mar 22 19:33:03 2021 +0000 @@ -10,6 +10,9 @@ int main() { +char receive_buffer[30]; + + blue.baud(9600); pc.baud(115200); @@ -22,8 +25,15 @@ myled2 = !myled2; if (blue.readable()) { - pc.putc(blue.getc()); + pc.gets(receive_buffer,30); // read all ascii chars (string) into buffer + + long int slider = strtol(receive_buffer,NULL,10); // convert string to a long integer + pc.printf("%ld ",slider);//printf long int slider myled = !myled; + + //pc.putc(blue.getc()); + + } if (pc.readable()) {