Can anyone advise or point me to the basic format for using the sin, cos, triwave functions? The fastled wiki mentions them but gives no examples, and elsewhere I can only find heinously complex examples that I don’t understand. As a newbie I want to feed simple numbers into them and serialprint them out so I can see what they’re doing. Ideally make them count up to 255 and back again in their various ways…
I get the impression angles are involved. So I’m doing this:
mysine = sin8(x)
and changing the x to different values and serial printing it, and getting cryptic stuff back. When x is 180 mysine is 9, when x is 0 mysine is 128, when x is 90 mysine is 228…?!?
Any other puzzled newbie interested, the script here is:
#include <FastLED.h>
byte mysine; //a byte type variable is 8 bits, 0-255.
void setup() {
Serial.begin(9600); //establish serial connection for output to Serial Monitor
}
void loop() {
for (int i=0; i<256; i++) { //value of i variable counts from 0 to 255
mysine = sin8(i); // sets mysine variable equal to whatever the output of sin8(i) is.
Here’s all of them. The major difference is really only their start values, plus a slight different in contours between cubicwave and quadwave. Obviously triwave is a straight up and down. missing/deleted image from Google+