Last active
September 18, 2022 08:58
-
-
Save cho0h5/43f5c3abd41af3dfece1d530282f0977 to your computer and use it in GitHub Desktop.
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
void setup() { | |
pinMode(13, OUTPUT); | |
OCR0A = 0xF9; // 249 | |
TCCR0B = (1 << WGM01) | (1 << CS01); // CTC, prescale | |
TIMSK0 = (1 << OCIE1A); // interrupt | |
} | |
void loop() { | |
} | |
ISR(TIMER0_COMPA_vect) { // 8000hz | |
digitalWrite(13, digitalRead(13) ^ 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment