/*
* GccApplication3.c
*
* Created: 08.10.2018 15:21:47
* Author : student
*/
#include <avr/io.h>
#include <inttypes.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>
//-----------------------------------------------------
volatile int x;
ISR(INT0_vect)
{
TCNT1=0;
x++;
}
ISR(INT1_vect)
{
TIMSK=0;
}
ISR(Timer1_COMPA_vect)
{
if(x<7)
x++;
}
int main(void)
{
TCCRA=0;
TCCRB=0;
TCNT1=0;
OCR1A=977;
TIMSK = _BV(OCIE1A);
TCCR1A= _BV(CS12) | _BV(CS10) | _BV(WGM12);
DDRB=0xFF;
GICR=_BV(INT0) | _BV(INT1);
MCUCR= _BV(ISC11) | _BV(ISC01);
sei();
x=0;
/* Replace with your application code */
while (1)
{
sleep_mode();
PORTB=~_BV(x);
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}