int pot = 0;
int set = 0;
void setup() {
TCCR2A = TCCR2A | 0x30;
TCCR2B = TCCR2B & 0xF8 | 0x01;
}
void loop() {
pot =127 - (analogRead(A0) / 8);
set = 127 - pot;
analogWrite(3, set -127);
analogWrite(11, pot);
}
input 0 V duty cycle 50%
input 1 V duty cycle 40%
input 2 V duty cycle 30%
According to the code, I need to adjust frequency to 20kHz. How can I modify the code ?