/*
* zadanie4b.c
*
* Created: 22.10.2015 11:45:17
* Author: d14valicek
*/
#define F_CPU 1000000UL
#include
#include
#include
int main(void)
{
DDRD = 0xFF; //vystup
DDRC = 0x00; //vstup
int hodnota = 1;
while(1)
{
PORTD =~hodnota;
_delay_ms(200);
if (bit_is_clear(PINC, 1)){
if(hodnota !=128){
hodnota = hodnota*2;
}
else{
hodnota = 1;
}
} else {
if(hodnota!=1){
hodnota = hodnota/2;
} else {
hodnota = 128;
}
}
}
return 0;
}