Created
April 1, 2015 18:18
-
-
Save ersatzavian/7cf3054d2894591feba6 to your computer and use it in GitHub Desktop.
Playing a 1s, 500 Hz tone with PinC on the imp002 EVB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Playing a 1-second, 500 Hz beep | |
| pwm <- hardware.pinC; | |
| // configure PWM generator for 500 Hz, 50% duty cycle | |
| pwm.configure(PWM_OUT, 1.0/500.0, 0.5); | |
| // in one second, callback changes PWM duty cycle to 0% to stop tone | |
| imp.wakeup(1, function() { | |
| pwm.write(0.0); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment