Oh right thats a new concept to me haha!
Okay, i changed up the example code a bit and used a pot to change the duty cycle, and its still output 1.9khz.
What am i doing wrong?
void setup() {
DDRB |= 0x03; // This is an alternative to pinMode()
TCCR0A = 0xA1;
TCCR0B = 0x01;
pinMode(A1, INPUT);
}
void loop() {
int test = map(analogRead(A1), 0, 1023, 0, 255);
OCR0A = test; // This is an alternative to analogWrite to pin 5. but 0 is outputs continuous LOW.
OCR0B = test; // This is an alternative to analogWrite to pin 6. output is 1/255 duty cycle.
}