Code for Technion Formula car sensors reader
Dependencies: mbed Buffer FATFileSystem
Fork of SX1272PingPong by
This is code is part of a Technion course project in advanced IoT, implementing a device to read and transmit sensors data from a Formula racing car built by students at Technion - Israel Institute of Technology.
How to install
- Create an account on Mbed: https://os.mbed.com/account/signup/
- Import project into Compiler
- In the Program Workspace select "Formula_Nucleo_Reader"
- Select a Platform like so:
- Click button at top-left
- Add Board
- Search "NUCLEO F103RB" and then "Add to your Mbed Compiler"
- Finally click "Compile", if the build was successful, the binary would download automatically
- To install it on device simply plug it in to a PC, open device drive and drag then drop binary file in it
Diff: main.cpp
- Revision:
- 6:44752b4f8ab1
- Parent:
- 5:f2431c4fe3bb
- Child:
- 7:c1bbd6c56979
diff -r f2431c4fe3bb -r 44752b4f8ab1 main.cpp --- a/main.cpp Fri Sep 19 15:24:34 2014 +0000 +++ b/main.cpp Tue Sep 23 14:24:56 2014 +0000 @@ -315,41 +315,41 @@ void OnTxDone( void ) { - debug_if( DEBUG_MESSAGE, "> OnTxDone\n\r", NULL ); Radio.Sleep( ); State = TX; + debug_if( DEBUG_MESSAGE, "> OnTxDone\n\r", NULL ); } void OnRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr) { - debug_if( DEBUG_MESSAGE, "> OnRxDone\n\r", NULL ); Radio.Sleep( ); BufferSize = size; memcpy( Buffer, payload, BufferSize ); RssiValue = rssi; SnrValue = snr; State = RX; + debug_if( DEBUG_MESSAGE, "> OnRxDone\n\r", NULL ); } void OnTxTimeout( void ) { - debug_if( DEBUG_MESSAGE, "> OnTxTimeout\n\r", NULL ); Radio.Sleep( ); State = TX_TIMEOUT; + debug_if( DEBUG_MESSAGE, "> OnTxTimeout\n\r", NULL ); } void OnRxTimeout( void ) { - debug_if( DEBUG_MESSAGE, "> OnRxTimeout\n\r", NULL ); Radio.Sleep( ); Buffer[ BufferSize ] = 0; State = RX_TIMEOUT; + debug_if( DEBUG_MESSAGE, "> OnRxTimeout\n\r", NULL ); } void OnRxError( void ) { - debug_if( DEBUG_MESSAGE, "> OnRxError\n\r", NULL ); Radio.Sleep( ); State = RX_ERROR; + debug_if( DEBUG_MESSAGE, "> OnRxError\n\r", NULL ); }