25 lines
338 B
C++
25 lines
338 B
C++
#define F_CPU 8000000UL
|
|
#include <avr/io.h>
|
|
#include <util/delay.h>
|
|
#include <avr/interrupt.h>
|
|
#include "photointerrupter.h"
|
|
|
|
|
|
int main()
|
|
{
|
|
photointerrupter::init();
|
|
DDRD |= (1<<PD6);
|
|
|
|
while(1);
|
|
return 0;
|
|
}
|
|
|
|
PHOTOINTERRUPT {
|
|
cli();
|
|
PORTD |= (1<<PD6);
|
|
_delay_ms(100);
|
|
PORTD &= ~(1<<PD6);
|
|
GIFR |= (1<<INTF1);
|
|
sei();
|
|
}
|