C++ Library for the PsiSwarm Robot - Version 0.8

Dependents:   PsiSwarm_V8_Blank_CPP Autonomia_RndmWlk

Fork of PsiSwarmV7_CPP by Psi Swarm Robot

Revision:
8:6c92789d5f87
Parent:
6:b340a527add9
Child:
9:dde9e21030eb
diff -r aa5a4a257895 -r 6c92789d5f87 psiswarm.cpp
--- a/psiswarm.cpp	Sun Oct 16 11:11:21 2016 +0000
+++ b/psiswarm.cpp	Sun Oct 16 12:54:33 2016 +0000
@@ -22,6 +22,11 @@
 
 #include "psiswarm.h"
 
+//Setup class instances
+Display display;  //Connects to i2c(p28,p27), reset(p29), backlight(p30)
+Motors motors;
+Eprom eprom;
+
 //Setup MBED connections to PsiSwarm Robot
 Serial pc(USBTX,USBRX);
 I2C primary_i2c (p9, p10);
@@ -36,7 +41,6 @@
 PwmOut motor_right_r(p24);
 PwmOut center_led_red(p25);
 PwmOut center_led_green(p26);
-Display display;  //Connects to i2c(p28,p27), reset(p29), backlight(p30)
 DigitalOut mbed_led1(LED1);
 DigitalOut mbed_led2(LED2);
 DigitalOut mbed_led3(LED3);
@@ -164,7 +168,7 @@
     debug("PsiSwarm Robot Library %1.2f\n\n",SOFTWARE_VERSION_CODE);
     debug("- Setting up serial interface\n");
     debug("- Reading firmware: ");
-    if(read_firmware() == 1) {
+    if(eprom.read_firmware() == 1) {
         debug("Version %3.2f\n",firmware_version);
         IF_get_hardware_description();
         if(use_motor_calibration){
@@ -203,7 +207,7 @@
         system_warnings += 1;
     }
     debug("- Setting up motor drivers\n");
-    IF_init_motors();
+    motors.init_motors();
     debug("- Setting up GPIO expansion\n");
     reset_encoders();
     IF_setup_gpio_expansion_ic();