Code for Technion Formula car sensors reader

Dependencies:   mbed Buffer FATFileSystem

Fork of SX1272PingPong by Semtech

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:
  1. Click button at top-left
  2. Add Board
  3. 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
Revision:
5:f2431c4fe3bb
Parent:
4:5ece30264cd9
Child:
6:44752b4f8ab1
diff -r 5ece30264cd9 -r f2431c4fe3bb main.cpp
--- a/main.cpp	Fri Sep 19 14:18:37 2014 +0000
+++ b/main.cpp	Fri Sep 19 15:24:34 2014 +0000
@@ -4,14 +4,14 @@
 #include "mbed_debug.h"
 
 /* Set this flag to '1' to display debug messages on the console */
-#define DEBUG_MESSAGE   1
+#define DEBUG_MESSAGE   0
 
 
 /* Set this flag to '1' to use the LoRa modulation or to '0' to use FSK modulation */
-#define USE_MODEM_LORA  0
+#define USE_MODEM_LORA  1
 #define USE_MODEM_FSK   !USE_MODEM_LORA
 
-#define RF_FREQUENCY                                    915000000 // Hz
+#define RF_FREQUENCY                                    868000000 // Hz
 #define TX_OUTPUT_POWER                                 14        // 14 dBm
 
 #if USE_MODEM_LORA == 1
@@ -74,8 +74,8 @@
 
 volatile States_t State = LOWPOWER;
 
-double RssiValue = 0.0;
-double SnrValue = 0.0;
+int16_t RssiValue = 0.0;
+int8_t SnrValue = 0.0;
 
 int main() 
 {
@@ -85,7 +85,7 @@
     debug( "\n\r\n\r     SX1276 Ping Pong Demo Application \n\r" );
         
 #if defined TARGET_NUCLEO_L152RE
-    debug( DEBUG_MESSAGE, "         > Nucleo-L152RE Platform <\r\n", NULL );
+    debug_if( DEBUG_MESSAGE, "         > Nucleo-L152RE Platform <\r\n", NULL );
 #elif defined TARGET_KL25Z
     debug_if( DEBUG_MESSAGE, "         > KL25Z Platform <\r\n", NULL );
 #elif defined TARGET_LPC11U6X
@@ -316,6 +316,7 @@
 void OnTxDone( void )
 {
     debug_if( DEBUG_MESSAGE, "> OnTxDone\n\r", NULL );
+    Radio.Sleep( );
     State = TX;
 }