Hi,
I am trying to create a slow LFO (0.05Hz to 5Hz would suffice), control would be via a potentiometer input to control the rate, nothing too fancy.
I have been basing my work on an example found online @
http://abrammorphew.com/notes/2012/01/05/arduino-lfo-generator/ This example uses timer intterupts and a sine table to derive a few wave shapes.
I have been slowing trying to grasp the timers and I'm kind of getting there.
I have altered timer0 prescaler to reduce speed slightly but more is needed: code snippet:
//---Timer 0 original ----///
cbi(TCCR0B,CS00);
cbi(TCCR0B,CS01);
sbi(TCCR0B,CS02);
//----End----------------//
//---Timer 0 my edit, 1024 ----//
sbi(TCCR0B,CS00); //1
cbi(TCCR0B,CS01); //0
sbi(TCCR0B,CS02); //1
//---End------------------------//
Can someone with more knowledge than me tell me how I could potentially change this code overall to decrease the speed further? I understand I could use delay(); generally speaking but I'm under the impression these timers and interrupt routines will be more stable over time?
Thank you and regards,