|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Honeywell Microswitch (Limit Switch)
I need to know how to program the microswitch so that when the lever is pushed down the light on the top pane of the drver station application lights up or somehow signals that the lever has been pressed.
|
|
#2
|
|||
|
|||
|
Re: Honeywell Microswitch (Limit Switch)
+1 for that. I want to know that too!
(while somewhat [not really] on the topic, we need a +1 button for when we want to know the answer too...) |
|
#3
|
||||
|
||||
|
Re: Honeywell Microswitch (Limit Switch)
It used to be that a couple years ago, there was sample code provided by FIRST that allowed you to send all your digital I/O, analog input data etc to the dashboard (DashboardDataFormat::SendIOPortData()). After kickoff this year, I briefly played with the code from two years ago and it did not work. I did not have time to figure out why. It is probably because the Dashboard data format has changed and we need an update to that sample code. You may look at it along that line.
However, there are many ways to feed the information back to the driver station. One of the possibilities is the DriverStationLCD class. If you are interested in that, I can explain how to use it. |
|
#4
|
||||
|
||||
|
Re: Honeywell Microswitch (Limit Switch)
I would appreciate if you could explain the DriverStation LCD class. We're using the switch for if the ball is at the correct position to shoot, so a simple output like "Ready for Shot" or something along those lines would really help. Thanks!
|
|
#5
|
||||
|
||||
|
Re: Honeywell Microswitch (Limit Switch)
Quote:
Code:
#define LCD_LINE1 DriverStationLCD::kUser_Line1
#define LCD_LINE2 DriverStationLCD::kUser_Line2
#define LCD_LINE3 DriverStationLCD::kUser_Line3
#define LCD_LINE4 DriverStationLCD::kUser_Line4
#define LCD_LINE5 DriverStationLCD::kUser_Line5
#define LCD_LINE6 DriverStationLCD::kUser_Line6
#define LCDPrintf(p) DriverStationLCD::GetInstance()->PrintfLine p
#define LCDUpdate() DriverStationLCD::UpdateLCD()
class MyRobot: public SimpleRobot
{
public:
MyRobot()
{
}
~MyRobot()
{
}
void Autonomous(void)
{
}
void OperatorControl(void)
{
while (IsEnabled() && IsOperatorControl())
{
LCDPrintf((LCD_LINE1, "ReadyToFire = %d", m_switchState));
....
LCDUpate();
}
}
};
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|