car using PID from centre line
Dependencies: FRDM-TFC mbed CBuffer XBEE mbed_angular_speed motor2 MMA8451Q
Fork of KL25Z_Camera_Test by
Diff: main.cpp
- Revision:
- 11:53de69b1840b
- Parent:
- 10:1bd0224093e4
- Child:
- 12:da96e2f87465
--- a/main.cpp Wed Nov 16 16:31:46 2016 +0000 +++ b/main.cpp Mon Nov 21 16:57:53 2016 +0000 @@ -169,11 +169,29 @@ pc.putc((int8_t)(TFC_LineScanImage0[i] >> 4) & 0xFF); } + + } + frame_counter++; + wL=Get_Speed(Time_L); wR=Get_Speed(Time_R); - sendString("wL = %f, wR = %f",wL,wR); - } - frame_counter++; + + union { + float a; + unsigned char bytes[4]; + } thing; + + pc.putc('B'); + thing.a = wL; + pc.putc(thing.bytes[0]); + pc.putc(thing.bytes[1]); + pc.putc(thing.bytes[2]); + pc.putc(thing.bytes[3]); + thing.a = wR; + pc.putc(thing.bytes[0]); + pc.putc(thing.bytes[1]); + pc.putc(thing.bytes[2]); + pc.putc(thing.bytes[3]); } inline void handleComms() {