View Single Post
  #2   Spotlight this post!  
Unread 03-03-2016, 22:48
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,570
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Help needed with algorithm

I'm not following what you're trying to do, or how the LEDs are arranged.

Are the LEDs arrayed in a line, a circle, or something else? Which LEDs do you expect to be lit at any given phase of the circle?

One thing that is unusual looking is the if block. Note that the LEDs for which
Code:
in <= pi * 2 * i / 24
Will be unchanged from whatever their previous state was. For most purposes of this type, you would have an else block to turn lights off or some such.

Edit: Also, did you really mean to have 24,000 calls to the cos() function per wave? That could take a while on an arduino.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.

Last edited by GeeTwo : 03-03-2016 at 22:59.
Reply With Quote