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 sendToVision();
|
||||||
void recvFromVision();
|
void recvFromVision();
|
||||||
void recvFromCompass();
|
void recvFromCompass();
|
||||||
|
void updateRSSI();
|
||||||
void emergencyStop();
|
void emergencyStop();
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
@ -144,6 +145,7 @@ void loop()
|
||||||
recvFromEnergy(); // Update stats from Energy
|
recvFromEnergy(); // Update stats from Energy
|
||||||
// recvFromVision(); // Update stats from Vision
|
// recvFromVision(); // Update stats from Vision
|
||||||
recvFromCompass(); // Update stats from Compass
|
recvFromCompass(); // Update stats from Compass
|
||||||
|
updateRSSI();
|
||||||
switch (Status)
|
switch (Status)
|
||||||
{
|
{
|
||||||
case CS_ERROR:
|
case CS_ERROR:
|
||||||
|
@ -196,7 +198,7 @@ void loop()
|
||||||
case INSTR_WAIT: // Normal wait
|
case INSTR_WAIT: // Normal wait
|
||||||
{
|
{
|
||||||
Status = CS_WAITING; // Set waiting state
|
Status = CS_WAITING; // Set waiting state
|
||||||
waitGoal = millis() + 1000*(instr->time); // Set wait time
|
waitGoal = millis() + 1000 * (instr->time); // Set wait time
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case INSTR_COLOUR:
|
case INSTR_COLOUR:
|
||||||
|
@ -486,6 +488,11 @@ void recvFromCompass()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updateRSSI()
|
||||||
|
{
|
||||||
|
signalStrength = WiFi.RSSI();
|
||||||
|
}
|
||||||
|
|
||||||
void emergencyStop()
|
void emergencyStop()
|
||||||
{
|
{
|
||||||
DynamicJsonDocument tdoc(1024);
|
DynamicJsonDocument tdoc(1024);
|
||||||
|
|
Loading…
Reference in a new issue