Hi,
I am working on a project to develop an attitude control system. I have a good part of the code ready and working.
I am struggling with the last part. When I press the button to change data being transmitted from the gyro to the LED/LCD1602, it only displays it once. I want it to display the data until the button is pressed again. I think that I have issues with timer and/or interrupt service routine.
Any ideas what code to use to make the code update live, while staying constrained to the functions specified?
I tried using this one, but it only makes the LED blink the whole time, not respecting the code from the loop now...:
noInterrupts();
TCCR1A = 0;
TCCR1B = 0;
TCNT1 = 0;
OCR1A = 31250;
TCCR1B |= (1 << WGM12);
TCCR1B |= (1 << CS12);
TIMSK1 |= (1 << OCIE1A);
interrupts();
}
ISR(TIMER1_COMPA_vect)
{
digitalWrite(43, digitalRead(43) ^ 1);
}
Any ideas how to help with that?
Many Thanks