We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Just needed help adjusting my processing code to make the LED fade in and out of color (or ease in/out), rather than just "appear/disappear". Here is a snippet of code for when the LED on pin9 activates in response to certain sound pitch range (f) being detected:
if(f > 175 && f < 237) {
background(255,0,0);
arduino.analogWrite(9, 255);
}
cheers!
Answers
It needs to be on a PWM pin - depends on which arduino you're using but pin 9 not usually PWM.
https://www.arduino.cc/en/Reference/AnalogWrite
it is on a pwm pin, I am pretty sure anyway. I ran a sample pwm sketch and the LED wored fine. I am using the Uno model. Regardless, lets just assume I am using the right pin. What would the code be?
This gives you a sawtooth value - just use value of LFO ie
(analogWrite 9, LFO);
Much appreciated! Going to test it out when I get home. Thank you