Skip to content

Instantly share code, notes, and snippets.

@dagon666
Created November 16, 2013 12:52
Show Gist options
  • Save dagon666/7499855 to your computer and use it in GitHub Desktop.
Save dagon666/7499855 to your computer and use it in GitHub Desktop.
1 kHz tone generation
#include "pca.h"
int main(void)
{
// initialize timer 0 as a tone generator
// TDELAY_IMPLEMENT_T0_INT must be set to 1 in config.h
beeper_init(E_TIMER0);
while (1) {
beeper_beep(E_TIMER0, 1000, 9000);
beeper_block(E_TIMER0);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment