Component Test's Software to work with "Universal Controller Box" - Software is an interpreter or "compiler" for programs to be done with a .txt file and read off of the SD Card
Dependencies: BridgeDriver FrontPanelButtons MCP23017 SDFileSystem TextLCD mbed
Diff: main.cpp
- Revision:
- 4:86d0d04cc055
- Parent:
- 3:078e9a1e8be3
- Child:
- 5:e36e0538a903
diff -r 078e9a1e8be3 -r 86d0d04cc055 main.cpp --- a/main.cpp Fri Sep 19 00:46:26 2014 +0000 +++ b/main.cpp Fri Sep 19 01:54:00 2014 +0000 @@ -10,6 +10,7 @@ //#include "Device.hpp" #include "Motor.hpp" #include "VoltageDriver.hpp" +#include "PinIN.hpp" #include "TextFile.h" #include <stdio.h> #include <string> @@ -86,25 +87,11 @@ lcd.printf(" "); // Clear the Line using Spaces (Emptyness) - Note one line is 20 Characters wait(.2); lcd.setAddress(0,3); - lcd.printf("%s",files[nextIndex]); + lcd.printf("%s", files[nextIndex]); return nextIndex; // Return the file index in the Array } - -/**********************************************************************************************************************************/ -/**********************************************************************************************************************************/ -/************************** <FUNCTION: resize_StringArr> ************************/ -/**********************************************************************************************************************************/ -/**********************************************************************************************************************************/ - -string* resize_StringArr(string oldArr[], int newSize) { - - string newArr[newSize]; - memcpy(newArr, oldArr, newSize * sizeof(string)); - - return newArr; -} /**********************************************************************************************************************************/ @@ -161,8 +148,9 @@ int i = 0, deviceFound = -1; for (i = 0; i < numDevices; i++){ - if (lineData.word[2].compare(DeviceNames[i])) + if (lineData.word[2].compare(DeviceNames[i]) == 0){ deviceFound = i; + } } //if the device type does not match any known type, error out