Created
February 23, 2020 06:54
-
-
Save rosmianto/cae9767d3bd23eac6a207878ef2fb088 to your computer and use it in GitHub Desktop.
How to Generate 4MHz clock with Arduino Uno
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() { | |
// put your setup code here, to run once: | |
TCNT1 = 0; | |
TCCR1B = B00001001; | |
TCCR1A = B01000000; | |
OCR1A = 1; // CLK frequency = 4 MHz | |
pinMode(9, OUTPUT); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment