#include <FastLED.h>
float BPM = 256;
float phase000 = (65535/360)* 0;
float phase090 = (65535/360)* 90;
float phase120 = (65535/360)*120;
float phase180 = (65535/360)*180;
float phase240 = (65535/360)*240;
float phase270 = (65535/360)*270;
void setup() {
Serial.begin(115200);
pinMode(2, OUTPUT); // sets the pin as output
pinMode(3, OUTPUT); // sets the pin as output
pinMode(4, OUTPUT); // sets the pin as output
}
void loop() {
float LFO1 = beatsin16(BPM*256,0,65535,0,0);
float LFO2 = beatsin16(BPM*256,0,65535,0,phase120);
float LFO3 = beatsin16(BPM*256,0,65535,0,phase240);
Serial.print(LFO1);
Serial.print(",");
Serial.print(LFO2);
Serial.print(",");
Serial.println(LFO3);
LFO1 = LFO1/256;
LFO2 = LFO2/256;
LFO3 = LFO3/256;
analogWrite(2, LFO1);
analogWrite(3, LFO2);
analogWrite(4, LFO3);
}