269
edits
Changes
Jump to navigation
Jump to search
// --- 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);
//anything?
//anything?
//anything?
//anything?
//anything?
no edit summary
Have you ever wondered what a little Arduino is really capable of? Ever wanted to ''really'' understand a chip? Learn lots of nitty-gritty details about the Microchip AVR architecture, the processor architecture that powers the Arduino and many other products.
Slides: [[Media:AVR-v0.pptx]]
Video: https://video.hacksburg.org/videos/watch/8c9e3a8d-41d5-4c56-8eef-814f9966ce3f
== 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++;
}
}
</pre>