//OCRnX in Void Loop section Not Working, i.e. if I want to use POT to control the duty Cycle
int Pin=9;
void setup() {
pinMode(Pin, OUTPUT);
pinMode(10,OUTPUT);
TCCR1A=0;//reset the register
TCCR1B=0;//reset the register
TCNT1=0;
TCCR1A=0b10100011;
TCCR1B=0b00000011;
//OCR1A=768;// instead in Void loop
OCR1B=400;
}
void loop() {
OCR1A=768;
}
In actual Arduino this sketch is working, in SimulIDE no signal on pin 9. Im using UNO both on SimulIDE and in actual arduino board.
int Pin=9;
void setup() {
pinMode(Pin, OUTPUT);
pinMode(10,OUTPUT);
TCCR1A=0;//reset the register
TCCR1B=0;//reset the register
TCNT1=0;
TCCR1A=0b10100011;
TCCR1B=0b00000011;
//OCR1A=768;// instead in Void loop
OCR1B=400;
}
void loop() {
OCR1A=768;
}
In actual Arduino this sketch is working, in SimulIDE no signal on pin 9. Im using UNO both on SimulIDE and in actual arduino board.