Go to Post And THAT is why they have safety manuals. - Eria4044 [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 21-08-2011, 21:12
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Programming Blinking LEDs?

We are trying to add some "bling" to our robot. We have added red and blue LED strips on our robot. The LED strips are connected to their own relays. We can program them to turn on, but we would like to get them to alternate between the red and blue colors every 3 seconds to create a blinking affect.

How do we program them to blink?

Can we get them to blink even when the robot is disabled?

Is their another approach we should try?
Reply With Quote
  #2   Spotlight this post!  
Unread 22-08-2011, 10:54
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,833
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: Programming Blinking LEDs?

Here are some variations to alternate Relays between on and off.
There are further variations that turn everything on at once and everything off.
These loops would go only in Periodic Tasks.vi.
  1. The first alternates between two cases and you can control the times of the blinks independently by passing in the delay time if you want.
  2. The second is another way to do the same thing without a Case statement. It only does one Relay, but you can add as many more as you want.
  3. The third wires two sets of LEDs to a single Relay and alternates between them
Relays only work while the robot is Enabled.
If you want them to blink while disabled, then you'd need a custom circuit that does the blinking for you as long as it gets power.
Attached Thumbnails
Click image for larger version

Name:	AlternateTwoRelays.jpg
Views:	55
Size:	62.5 KB
ID:	10893  Click image for larger version

Name:	AlternateOneRelay.jpg
Views:	42
Size:	25.6 KB
ID:	10894  Click image for larger version

Name:	AlternateTwoOnOneRelay.jpg
Views:	39
Size:	33.9 KB
ID:	10895  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 22-08-2011 at 13:14.
Reply With Quote
  #3   Spotlight this post!  
Unread 22-08-2011, 13:38
PAR_WIG1350's Avatar
PAR_WIG1350 PAR_WIG1350 is offline
Registered User
AKA: Alan Wells
FRC #1350 (Rambots)
Team Role: Alumni
 
Join Date: Dec 2009
Rookie Year: 2009
Location: Rhode Island
Posts: 1,189
PAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond reputePAR_WIG1350 has a reputation beyond repute
Re: Programming Blinking LEDs?

I found a circuit that uses a 555 timer to turn on for 0-10 seconds and off for 0-100 seconds (It's called a programmable timer in the book, but the timing is actually adjusted by potentiometers and by using different capacitors). Circuits such as this are not hard to find schematics for and allow you to achieve the desired result without messing around with, and possibly slowing down your code. (also, they will continue to blink when the robot is disabled.

Edit: Here is a good reference to use when designing 555 based timers: http://www.kpsec.freeuk.com/555timer.htm#astable
__________________

Last edited by PAR_WIG1350 : 22-08-2011 at 13:43.
Reply With Quote
  #4   Spotlight this post!  
Unread 18-10-2011, 08:46
tr6scott's Avatar
tr6scott tr6scott is online now
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 522
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Programming Blinking LEDs?

This is a little routine we built last year, to play "TORC RULES" in Morse code during autonomous mode.

When you get the arrays set, remember to use the "Make default data" to remember the arrays, or you may be doing them a couple of times.

Good Luck, Scott.
Attached Files
File Type: vi TORC_RULES_MORSE_CODE.vi (7.4 KB, 8 views)
__________________
The sooner we get behind schedule, the more time we have to catch up.

Reply With Quote
  #5   Spotlight this post!  
Unread 18-10-2011, 22:30
baronep's Avatar
baronep baronep is offline
Student President
FRC #2848 (Jesuit All-Sparks)
Team Role: Leadership
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Dallas TX
Posts: 167
baronep is on a distinguished road
Re: Programming Blinking LEDs?

I'm not positive that this is allowed but I think it warrants the suggestion. You may want to consider using a custom circuit for your led stripping. Because it is a nonfunctional decoration, it is free game for circuits. Instead of using relays, maybe you might consider MOSFET transistors combined with an arduino control board. This way you can limit the workload on the crio, have the LEDs blink in disabled mode, and you can still change the pattern using a serial link to the crio.
Reply With Quote
  #6   Spotlight this post!  
Unread 21-10-2011, 06:11
tr6scott's Avatar
tr6scott tr6scott is online now
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 522
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: Programming Blinking LEDs?

Wildstang did that last year. Great effect. http://www.chiefdelphi.com/forums/sh...threadid=96854
__________________
The sooner we get behind schedule, the more time we have to catch up.

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 20:38.

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