Go to Post Someone want to channel their inner Mark Leon and do the math? - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-02-2012, 22:18
dmitch's Avatar
dmitch dmitch is offline
Chief Head Electrical Guy
AKA: Daniel Mitchell
FRC #1997 (Stag Robotics)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Bishop Miege High School
Posts: 142
dmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the rough
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.
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 17-02-2012, 17:37
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
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...)
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote
  #3   Spotlight this post!  
Unread 17-02-2012, 17:55
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 671
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
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.
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 18-02-2012, 10:19
dmitch's Avatar
dmitch dmitch is offline
Chief Head Electrical Guy
AKA: Daniel Mitchell
FRC #1997 (Stag Robotics)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Bishop Miege High School
Posts: 142
dmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the rough
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!
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 18-02-2012, 13:54
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 671
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Honeywell Microswitch (Limit Switch)

Quote:
Originally Posted by dmitch View Post
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!
You can paste the following macros into your file and use them. Note that these set of macros make life easier but the double paranthesis on LCDUpdate is required to make the macro work. You only need to call LCDUpdate once per loop. It refreshes the message display on the Driver Station. In other words, you can call LCDPrintf on several things, one per LCD line and then call LCDUpdate once to "deliver" the lines to the driver station.
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();
        }
    }
};
__________________
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi