NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » How can I play an LFO on a square wave.
May 13, 2011 by rboggs10 |
I want to be able to use a sine wave Low Frequency Oscillator to alter the frequency of the square wave generated by my NerdKit. So what I want is to give my note some vibrato. The way that I am playing the note is based off of the "Making Music with a Microcontroller" video so if I wanted to play a D5 note on the PC4 pin I would code this:
|
---|---|
May 13, 2011 by bretm |
Does it have to be a sine wave, or will triangle wave do?
Total duration of each trip through the while loop is about 166700us, which gives a 6Hz vibrato which should be about right. |
May 14, 2011 by rboggs10 |
Thanks for the reply. That is a good idea but I have changed my plan and I am going to try using PWM to play my notes. |
Please log in to post a reply.
Did you know that there are Power MOSFETs for switching big loads on and off? Learn more...
|