Railway Challenge
/
challenge
Uncommenting of part that allow supercaps to charge up from the batteries
Diff: main.cpp
- Revision:
- 3:32e951e05a5b
- Parent:
- 2:d8d92dfc9c82
- Child:
- 4:d9279fc3a8fb
--- a/main.cpp Tue Apr 12 16:46:46 2022 +0000 +++ b/main.cpp Tue Apr 12 17:19:05 2022 +0000 @@ -7,6 +7,8 @@ #include "rtc.h" #include "motor.h" #include "challenge.h" +#include <sstream> +using std::string; // SET UP REMOTE CONTROL COMMS SPI remoteControl(PE_14, PE_13, PE_12); // (SPI_MOSI, SPI_MISO, SPI_SCK) @@ -24,6 +26,14 @@ // FUNCTIONS +//Display Function for data logger +void DisplaySerial(){ + std::stringstream displayline; + displayline << "Blackbox# " << " Motor Accelerator: " << motorAccelerator << "Emergency Stop Status: " << emergencyStopActive << "Drive Mode: " << driveMode ; // + "Current Speed: " +(int)dashboard.currentSpeed; + string disp=displayline.str(); + pc.printf("%s",disp); + } + void startupHealthCheck() { while(1) { @@ -343,6 +353,7 @@ unsigned long lastErrorMillis = 0; while(1) { + DisplaySerial();//Datalogger Chai Funciton while(remote.commsGood == true) {