Modified version of the UKESF lab source which can be carried out with no knowledge of C

Fork of PsiSwarm-Headstart by UKESF Headstart Summer School

Revision:
4:dc77a25f29de
Parent:
2:c6986ee3c7c5
--- a/eprom.cpp	Tue Mar 15 00:58:09 2016 +0000
+++ b/eprom.cpp	Mon Jun 20 13:35:06 2016 +0000
@@ -5,9 +5,9 @@
  * (C) Dept. Electronics & Computer Science, University of York
  * James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis
  *
- * PsiSwarm Library Version: 0.41
+ * PsiSwarm Library Version: 0.5
  *
- * March 2016
+ * April 2016
  *
  * Functions for accessing the 64Kb EPROM chip and reading the reserved firmware block
  *
@@ -105,6 +105,19 @@
         has_temperature_sensor= firmware_bytes[19];
         has_recharging_circuit= firmware_bytes[20];
         has_433_radio= firmware_bytes[21];
+        if(firmware_version > 1.0){
+        motor_calibration_set = firmware_bytes[22];
+        if(motor_calibration_set == 1){
+            left_motor_calibration_value = (float) firmware_bytes[23] * 65536;
+            left_motor_calibration_value += ((float) firmware_bytes[24] * 256);
+            left_motor_calibration_value += firmware_bytes[25];
+            left_motor_calibration_value /= 16777216;
+            right_motor_calibration_value = (float) firmware_bytes[26] * 65536;
+            right_motor_calibration_value += ((float) firmware_bytes[27] * 256);
+            right_motor_calibration_value += firmware_bytes[28];
+            right_motor_calibration_value /= 16777216;
+        }
+        } else motor_calibration_set = 0;
         return 1;
     }
     return 0;