The Code Repository for the REV0 Steering Wheel.
Dependencies: CANBuffer KS0108_fork mbed-rtos mbed CAN Addresses
Fork of REVO_Updated_Steering by
Diff: Steering.cpp
- Revision:
- 42:701df58e923a
- Parent:
- 41:7c5ea411fad2
- Child:
- 44:80d821b5a0e7
- Child:
- 47:5d3c6f85fa29
--- a/Steering.cpp Sun Feb 08 08:53:44 2015 +0000 +++ b/Steering.cpp Mon Mar 23 19:36:37 2015 +0000 @@ -103,15 +103,11 @@ // printf("Message ID: 0x%x len: %d hex: 0x%x float: %f\r\n", Rxmsg.id, Rxmsg.len, *((int*)((void*)(&Rxmsg.data[0]))), *((float*)((void*)(&Rxmsg.data[0])))); // for (int i=0; i < Rxmsg.len; i++) printf("D[%d]: %x ", i, Rxmsg.data[i]); if (Rxmsg.id == MODE_TX_ID) { - CANFloat = GetFloat; - sprintf(&DriveStatus,"%3.2d", int(CANFloat)); //confirm that I am interpreting this correctly - DriveStatusRequestBuffer = !DriveStatus; - if (DriveStatus == 1) { - BLButtonGreen; - } else { - BLButtonRed; + if(Rxmsg.data[0] != (1<<3)) + DriveStatusRequestBuffer=1; + else + DriveStatusRequestBuffer=0; } - } if (Rxmsg.id == POWER_TX_ID) { CANFloat = GetFloat;