leds.c
void LEDs_init()
{
    // Shift register clock, storage register clock, output enable
    // are all outputs.
    DDRD |= (1 << PD4) | (1 << PD6) | (1 << PD7);

    // Serial data input is also an output.
    DDRB |= (1 << PB4);

    // Set output enable to 0 (enables outputs on shift register)
    PORTD &= ~(1 << PD7);

    // Enable output compare interrupt
    TIMSK0 |= (1 << OCIE0A);

    // Turn on timer0 with 256x prescalar
    TCCR0B |= (1 << CS02);

    for (int i=0; i < 8; ++i)   LEDs[i] = 0;
}
// Values from 0 to 7, with 7 being brightest
Values from 0 to 7, with 7 being brightest
Values from 0 to 7 with 7 being brightest
void LEDs_init()
{
    DDRD |= (1 << PD4) | (1 << PD6) | (1 << PD7);
    DDRB |= (1 << PB4);
    PORTD &= ~(1 << PD7);
    TIMSK0 |= (1 << OCIE0A);
    TCCR0B |= (1 << CS02);
    for (int i=0; i < 8; ++i)   LEDs[i] = 0;
}
void LEDs_init ( ) { DDRD |= ( 1 << PD4 ) | ( 1 << PD6 ) | ( 1 << PD7 ) ; DDRB |= ( 1 << PB4 ) ; PORTD &= ~ ( 1 << PD7 ) ; TIMSK0 |= ( 1 << OCIE0A ) ; TCCR0B |= ( 1 << CS02 ) ; for ( int i = 0 ; i < 8 ; ++ i ) LEDs [ i ] = 0 ; }
Values from 0 to 7, with 7 being brightest
Values from 0 to 7 with 7 being brightest
// Shift register clock, storage register clock, output enable // are all outputs. // Serial data input is also an output. // Set output enable to 0 (enables outputs on shift register) // Enable output compare interrupt // Turn on timer0 with 256x prescalar