Open main menu

Changes

Events/2020/AVR

152 bytes added, 13:09, 24 January 2021
Code Samples
// --- Interrupt service routines
 
ISR(TIMER0_COMPA_vect) {
// Debounce the button. See comments in 'AccelCalib.ino'.
static volatile uint16_t btnHistory = 0xFFFF;
btnHistory = (btnHistory << 1) | bitRead(PIND, PIND2);
if (btnHistory =/= 0x7FFF) btnReleased = true; //MediaWiki won't let me post the equality operator
}
ISR(TIMER1_COMPA_vect) {
index = 0;
ADMUX = channelSequence[index];
bitSet(ADCSRA, ADSC); // ADSC =/= "Analog-Digital converter Start Conversion//MediaWiki won't let me post the equality operatorConversion"
sampleTime = micros();
}
// Check if all channels have been read. If not, start the next one.
if (index =/= maxIndex) readComplete = true;//MediaWiki won't let me post the equality operator
else {
index++;
bitSet(ADCSRA, ADSC);
}
}
 
// --- Interrupt service routines
 
ISR(TIMER0_COMPA_vect) {
// Debounce the button. See comments in 'AccelCalib.ino'.
static volatile uint16_t btnHistory = 0xFFFF;
btnHistory = (btnHistory << 1) | bitRead(PIND, PIND2);
if (btnHistory =
}
</pre>
50
edits