mirror of
https://github.com/team2059/Zaphod
synced 2025-01-07 22:14:14 -05:00
Added a shooting power indicator to the dashboard with refreshing
This commit is contained in:
parent
4d176a607d
commit
d05dfd3e8d
@ -2,11 +2,14 @@
|
|||||||
|
|
||||||
ZaphodDashboard::ZaphodDashboard()
|
ZaphodDashboard::ZaphodDashboard()
|
||||||
{
|
{
|
||||||
|
//Add Dashboard Initalizations here (for now)
|
||||||
|
SmartDashboard::PutNumber("Shooting Power", 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
float ZaphodDashboard::getKeyValue(const char* key)
|
float ZaphodDashboard::getKeyValue(const char* key)
|
||||||
{
|
{
|
||||||
return 1.0f;
|
float value = SmartDashboard::GetNumber(key);
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZaphodDashboard::putKeyValue(const char* key, float value)
|
bool ZaphodDashboard::putKeyValue(const char* key, float value)
|
||||||
|
@ -89,6 +89,11 @@ void ZaphodRobot::driveRobot(float x, float y)
|
|||||||
left3->SetRaw(int(leftPower));
|
left3->SetRaw(int(leftPower));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ZaphodRobot::updateDashboard()
|
||||||
|
{
|
||||||
|
dashboard->putKeyValue("Shooting Power", ControlSystem->throttle);
|
||||||
|
}
|
||||||
|
|
||||||
//Main function used to handle periodic tasks on the robot
|
//Main function used to handle periodic tasks on the robot
|
||||||
|
|
||||||
void ZaphodRobot::handler()
|
void ZaphodRobot::handler()
|
||||||
@ -100,6 +105,7 @@ void ZaphodRobot::handler()
|
|||||||
compressorSystem->compressorSystemPeriodic();
|
compressorSystem->compressorSystemPeriodic();
|
||||||
collector->updateCollector(shooter->isShooting, shooter->getAngle());
|
collector->updateCollector(shooter->isShooting, shooter->getAngle());
|
||||||
driveRobot(ControlSystem->rightJoystickAxisValues[3]+ControlSystem->rightJoystickAxisValues[1], -ControlSystem->rightJoystickAxisValues[2]);
|
driveRobot(ControlSystem->rightJoystickAxisValues[3]+ControlSystem->rightJoystickAxisValues[1], -ControlSystem->rightJoystickAxisValues[2]);
|
||||||
|
updateDashboard();
|
||||||
|
|
||||||
//Button assignments to actions
|
//Button assignments to actions
|
||||||
if(ControlSystem->leftJoystickValues[SHOOTER_FIRE])
|
if(ControlSystem->leftJoystickValues[SHOOTER_FIRE])
|
||||||
|
@ -30,6 +30,7 @@ class ZaphodRobot
|
|||||||
float getRearSonar();
|
float getRearSonar();
|
||||||
bool checkJoystickValues();
|
bool checkJoystickValues();
|
||||||
void driveRobot(float,float);
|
void driveRobot(float,float);
|
||||||
|
void updateDashboard();
|
||||||
void handler();
|
void handler();
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user