I’m not sure if this is the correct place to post, I’m pretty new to this.
I’m attempting to build a “slow dance” picture frame by working backward from the open source code. There is a section on the code I’m having trouble following.
ISR(TIMER0_COMPA_vect) { // Use pin D6 as PWM to control D4 and D5
uint8_t sample = pgm_read_byte_near(waveform + outputIndex++);
if (sample) {
PORTD &= ~(1 << PIN_COIL1);
PORTD |= (1 << PIN_COIL2);
} else {
PORTD |= (1 << PIN_COIL1);
PORTD &= ~(1 << PIN_COIL2);
}
if (outputIndex > WAVEFORM_SIZE) {
outputIndex = 0;
}
}
In this code PIN_COIL1 is D4 and PIN_COIL2 is D5. I’m trying to understand how D6 is used to control D4 and D5.
I understand that without seeing the entirety of the project this may be is not enough information to get help.
Thanks for any help that can be given or direct me to where I can learn more about this