turn on the light - question

Greetings,
Our rotating beacon is currently on whenever the robot has power. Should
I set it to only power on when comp_mode is 1. That way its off, until the start of the competition ?

just want to do it right.

thanks.

You need to hook up your light to a spike relay connected to one of the relay outputs on the robot controller. In your program, all you need to do is be sure that that relay is on all the time. The robot controller will take care of turning it off when your robot is disabled.

Right now, I have it on a relay that is on all the time. (when power is applied to
the robot). Other than that, I need to do nothing else with the light ? Sorry but I want to get it right.

*Originally posted by powercat *
**Right now, I have it on a relay that is on all the time. (when power is applied to
the robot). Other than that, I need to do nothing else with the light ? Sorry but I want to get it right. **

That is correct. Whenever the robot is in “disabled” mode, all relays and PWMs will be set to 0 or 127, respectively, regardless of what your code is telling them to do. This is to insure that it is impossible to drive before or after the match.

*Originally posted by powercat *
**Right now, I have it on a relay that is on all the time. (when power is applied to
the robot). Other than that, I need to do nothing else with the light ? Sorry but I want to get it right. **

Are you saying that you already had your light hooked up as Rob and I described, and you still observed the behavior you described in your original post? Or are you just expressing incredulity that my advice was correct?:eek:

Take a look at the Robot Electrical Blueprint. Near the lower left corner it shows how your light and its relay need to be connected electrically. (It omits the ground wire from the relay back to the distribution panel. If you need help with that let us know.) You’ll note that the light is isolated from the rest of the electrical system by the relay. (That is, the light wires are not connected to the same terminals as any other wires.)

If your light is connected as shown, then you have a bad spike relay.

Sorry, not trying to offend anyone.
I have the rotating light connected to
relay8.

relay8_fwd = 1

set that in the code.

when power is applied to the robot, the
red light starts rotating immediately. I
have not tried the disable button on our competition port dongle to see if the light stops when it is pressed.

Am going to have to check real quick.

*Originally posted by powercat *
Sorry, not trying to offend anyone.

No offense taken. Just trying to understand.:slight_smile:

*Originally posted by powercat *
**Greetings,
Our rotating beacon is currently on whenever the robot has power. Should
I set it to only power on when comp_mode is 1. That way its off, until the start of the competition ?

just want to do it right.

thanks. **

ok. thats correct, all you have to do is put a section of code in that looks like this:

'===========Turn on rotating light ====================
relay8_fwd=1
relay8_rev=1

'==============================================

Depending on your electricians, your light will turn on either on FWD or REV. Change one to 0 and if it dosent turn on, change the other to 0 and that one to 1. Also, the OI takes care of the light, and other “stuff”. That has the same effect as “disabled” (unplugging your OI)

what’s wrong with just plugging it into one of the 20amp fuses and grounding it?

*Originally posted by Lord Nerdlinger *
**what’s wrong with just plugging it into one of the 20amp fuses and grounding it? **

The light is only supposed to be on when the robot is enabled. Basically, you dont want the robot to be flashing in the pits. The best way (and, to my knowledge ,the ONLY way) is the way i described earlier.

The best part?

relay8_fwd = 1 – light turns clockwise
relay8_rev = 0

relay8_fwd = 0 – light turns counterclockwise
relay8_rev = 1

*Originally posted by Abwehr *
**The best part?

relay8_fwd = 1 – light turns clockwise
relay8_rev = 0

relay8_fwd = 0 – light turns counterclockwise
relay8_rev = 1 **

The lead programmer on our team used this as a little extra 2 years ago. He made some auto-balancing code, and when the robot was balanced on the bridge, the light reversed directions.
It had no real purpose, but it was nifty to see.

I can imagine the excitement :smiley: