NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » An interesting beep
February 26, 2010 by bretm |
I'm making a circuit with a numeric keypad and I wanted it to beep each time a key is pressed. I came up with the code below. It plays a 1760Hz tone for 1/20th of a second. It starts out at 50% duty cycle and gradually reduces the duty cycle to near 0% by the end of the duration. This gives it a lot of funky changing overtones.
|
---|
Please log in to post a reply.
Did you know that binary numbers use base 2 to represent numbers, and these are important for understanding microcontroller registers? Learn more...
|