I recently purchased an arduino UNO R4 Wifi arduino and wanted to make the following PWM control code, however this code was from an arduino uno R3.
I understand that the controller changed and is now a different one, do you know how I could modify the code?
int valorpwm;
void setup() {
pinMode(9, OUTPUT);//1kHz
TCCR1B=1;//PIN 9 Y 10 A 31kHz
TCCR2B=1;//PIN 11 Y 3 A 31kHz
}
void loop() {
valorpwm=analogRead(A0);
valorpwm=valorpwm/4;
analogWrite(9, valorpwm);
}