Advertisement
TheNH813

Arduino 50% PWM of variable frequency insanity

Aug 14th, 2016
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. const byte TX_ANT = 9;
  2.  
  3. void setup() {
  4. DDRB = _BV(DDB1); //Enable output.
  5. TCCR1A = _BV(COM1A0); //Enable compare match clock
  6. OCR1A = 79; //Divides Arduino 8MHz reference clock (Derived every other clock cycle).
  7. TCCR1B = _BV(WGM12) | _BV(CS10); //Enable CTC Prescaler Division
  8. pinMode(TX_ANT, OUTPUT);
  9. }
  10.  
  11. void loop() {
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement