mirror of
https://github.com/supleed2/ELEC50003-P1-CW.git
synced 2024-12-22 21:45:49 +00:00
Add missing RSSI / Signal Strength tracking
This commit is contained in:
parent
8353103e1f
commit
6ca4be5e11
|
@ -46,6 +46,7 @@ void recvFromEnergy();
|
|||
void sendToVision();
|
||||
void recvFromVision();
|
||||
void recvFromCompass();
|
||||
void updateRSSI();
|
||||
void emergencyStop();
|
||||
#pragma endregion
|
||||
|
||||
|
@ -144,6 +145,7 @@ void loop()
|
|||
recvFromEnergy(); // Update stats from Energy
|
||||
// recvFromVision(); // Update stats from Vision
|
||||
recvFromCompass(); // Update stats from Compass
|
||||
updateRSSI();
|
||||
switch (Status)
|
||||
{
|
||||
case CS_ERROR:
|
||||
|
@ -196,7 +198,7 @@ void loop()
|
|||
case INSTR_WAIT: // Normal wait
|
||||
{
|
||||
Status = CS_WAITING; // Set waiting state
|
||||
waitGoal = millis() + 1000*(instr->time); // Set wait time
|
||||
waitGoal = millis() + 1000 * (instr->time); // Set wait time
|
||||
}
|
||||
break;
|
||||
case INSTR_COLOUR:
|
||||
|
@ -486,6 +488,11 @@ void recvFromCompass()
|
|||
}
|
||||
}
|
||||
|
||||
void updateRSSI()
|
||||
{
|
||||
signalStrength = WiFi.RSSI();
|
||||
}
|
||||
|
||||
void emergencyStop()
|
||||
{
|
||||
DynamicJsonDocument tdoc(1024);
|
||||
|
|
Loading…
Reference in a new issue