Skip to content

Instantly share code, notes, and snippets.

@mpentler
Created February 10, 2021 23:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpentler/425a613b4394de4772fa52903f49b524 to your computer and use it in GitHub Desktop.
Save mpentler/425a613b4394de4772fa52903f49b524 to your computer and use it in GitHub Desktop.
#include <avr/io.h>
#include <util/delay.h>
int ledPWM1 = 0;
int ledPWM2 = 1;
void setup() {
DDRB = 0b00011111;
PORTB = 0b00011100;
TCCR0A = 3<<COM0A0 | 3<<COM0B0 | 3<<WGM00;
}
void loop() {
OCR0A = random (50, 120));
OCR0B = random (50, 120));
delay(random(100));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment