Answer the question
In order to leave comments, you need to log in
How to control a timer in Arduino?
There is an Arduino UNO with an atmega328p on board. I'm trying to set a timer for 250 microseconds.
I am using the following code:
void setup()
{
DDRC = 0xFF;
DDRB = 0xFF;
TCNT1 = 0;
TCCR1B = /*_BV(CS11)|*/_BV(CS10);
TCNT1 = 0;
//TIMSK1 = _BV(TOIE1);
TIMSK1 |= (1<<TOIE1);
//-TIMER1_OVF_vect
sei();
}//setup()
void loop()
{
}
volatile uint8_t pp = 0;
ISR(TIMER1_OVF_vect)
{
pp = ~pp;
PORTC = pp;
PORTB = pp;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question