|
Re: Help needed with algorithm
Quote:
Originally Posted by GeeTwo
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)
|