View Single Post
  #3   Spotlight this post!  
Unread 03-03-2016, 23:43
ArtemusMaximus's Avatar
ArtemusMaximus ArtemusMaximus is offline
Enginerd
FTC #11722
Team Role: Coach
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Canada
Posts: 248
ArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to all
Re: Help needed with algorithm

Quote:
Originally Posted by GeeTwo View Post
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.
I am trying to make a single wave like this http://people.sinclair.edu/nickreede...iftMinus90.gif spans over 4 LEDs

Code:
in <= pi * 2 * i / 24
this was intended to have values assigned to LEDs only after RAD passes step value

My brain so hurts right now thinking about it, I may put it aside for a bit in favour of linear values
__________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
2017 FTC 11722 (Coach)
2016 FTC 10544 (Coach) Canadian Championship Finalist, Rockwell Collins Innovate Award.
2014 FRC 5064 (Mentor)
Reply With Quote