All pastes #754461 Raw Edit

Flashy flash

public c v1 · immutable
#754461 ·published 2007-10-30 00:46 UTC
rendered paste body
#include <avr\io.h>#include <avr\interrupt.h>#define OCP PINB1volatile int currentMillisecond = 0;//Output compare ISRSIGNAL(SIG_TIMER1_COMPA){   PORTD ^=(1<<PD0);            //Toggle PortD0 }//Roughly 1 secondvoid timer1(void){   OCR1A = 0x0F42;               //Set OCR1A   TCCR1A = 0x00;                //Timer counter control register   TCCR1B = (0 << WGM13)|(1 << WGM12)|(1 << CS12)|(0 << CS11)|(1 << CS10); // WGM1=4, prescale at 1024   TIMSK |= (1 << OCIE1A);         //Set bit 6 in TIMSK to enable Timer 1 compare interrupt.   sei();} int main(void) {	DDRD = 0xFF;          // Set port D as output    	timer1();	for (;;) {	/* loop forever timer does the job*/    }}