Go to Post 610 is an all boys school, and we were surprised to see our pit and robot neatly decorated with hot pink boas and flowers upon arrival this morning. - Mr. Lim [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 23-01-2009, 08:28
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Digital Outputs on the Driver Station with C/C++

Last night we wired up a bank of LEDs so that we could do real-time debugging without relying on printfs or the debugger (both of which are slow). However, we couldn't get them to actually turn on and off.

If we plug them into the digital outputs with the positive wire to the center pin of the DS digital out and the signal wire to the signal (top) pin of the DS, they'll turn on. Likewise, if we put the signal wire to the ground pin of the DS, they'll turn on that way as well. However, we couldn't get them to turn off programmatically.

Inside our operator control loop, we tried:
ds->SetDigitalOut(8,false); // turn off digital output 8 (I may have got the function call wrong here, I'm going off memory)

We tried that just to see if we could turn them off, and nothing happened. We plugged the light into every single digital output to see if we got the number wrong, but they were all still on.

I'm guessing there is some jumper or code setting we have to flip in order for this to work. We read part 3 of the setup manual (which includes specs on the outputs) and couldn't find anything. Can anyone help us?

Last edited by Bongle : 23-01-2009 at 08:46.
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2009, 08:43
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,830
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Digital Outputs on the Driver Station with C/C++

Quote:
Originally Posted by Bongle View Post
If we plug them into the digital inputs...
Plug them into the Digital OUTPUTS

I'm sure you just called them "inputs" by mistake.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 23-01-2009 at 08:47.
Reply With Quote
  #3   Spotlight this post!  
Unread 23-01-2009, 08:46
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: Digital Outputs on the Driver Station with C/C++

Quote:
Originally Posted by Mark McLeod View Post
Plug them into the Digital OUTPUTS

I'm sure you just called them "inputs" by mistake.
Oops, we were definitely on the ouputs (the 8 sets of pins near the 'top' of the DS), I made a typo


I should also note that we hooked the LEDs to the robot's digital outputs and had great success with that. But since we want some driver feedback that isn't just a laptop on the dashboard port, we want to use the digital outputs.
Reply With Quote
  #4   Spotlight this post!  
Unread 23-01-2009, 10:15
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,830
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Digital Outputs on the Driver Station with C/C++

I believe you may have to update the dashboard to get this to take effect.
The set outputs have to be transmitted back to the DS as part of the periodic packet transmission and there might be some interdependency there.

P.S. I don't know though. I haven't played with this particular path yet.
I'll give it a try later if I can.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 23-01-2009 at 10:47.
Reply With Quote
  #5   Spotlight this post!  
Unread 23-01-2009, 13:12
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Digital Outputs on the Driver Station with C/C++

Quote:
Originally Posted by Bongle View Post
If we plug them into the digital outputs with the positive wire to the center pin of the DS digital out and the signal wire to the signal (top) pin of the DS, they'll turn on. Likewise, if we put the signal wire to the ground pin of the DS, they'll turn on that way as well. However, we couldn't get them to turn off programmatically.
I think they all start out off, so turning them off won't make any difference. You've just wired it so that "off" lights the LED.

Put the positive wire on the signal pin and the negative wire on the ground pin instead, and you should see the LED light up when you turn the output on.
Reply With Quote
  #6   Spotlight this post!  
Unread 26-01-2009, 09:19
Kruuzr Kruuzr is offline
Mentor - electrical, software
AKA: Steve Cote
FRC #1922 (Ozram)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Henniker, NH
Posts: 33
Kruuzr has a spectacular aura aboutKruuzr has a spectacular aura about
Re: Digital Outputs on the Driver Station with C/C++

You should also wire something like a 150 ohm resistor inline to limit the current going through the LED!

Steve C.
Reply With Quote
  #7   Spotlight this post!  
Unread 26-01-2009, 15:45
Bryscus's Avatar
Bryscus Bryscus is offline
EE, CpE
AKA: Bryce B.
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 1999
Location: Jupiter, FL
Posts: 173
Bryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud of
Re: Digital Outputs on the Driver Station with C/C++

Here's how to quickly calculate what resistor you should use for your LED. You will need to know the current consumption of the LED and the forward voltage of the LED (when a diode turns on, it more or less maintains a constant voltage accross itself). The relationship between current, resistance and voltage is defined in Ohm's law, V = IR (where V is voltage, I is current and R is resistance).

Vf = forward voltage of the diode
Id = diode current

The voltage supplied by the digital I/O port is 5V.

Since the diode and resistor are in series, they will have the same current flowing through them.

This means that the voltage accross the diode added to the voltage accros the resistor must equal 5 volts. Thus, 5V = Vf + (Id * R).

or R = (5V - Vf ) / Id

Hope that's a help as well...
__________________
The opulence of the front office decor varies inversely with the fundamental solvency of the firm.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using driver station digital inputs Japper FRC Control System 6 19-01-2009 20:01
Flashing Driver Station Digital Input MacGyver1718 FRC Control System 3 15-01-2009 19:22
Timing with the Driver Station Zorkinian Programming 6 10-01-2009 09:42
Help with updating firmware on Driver Station urg8rb8 FRC Control System 3 28-12-2008 02:53
Interrupt on driver station digital input Nameless Programming 9 04-12-2008 16:55


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

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