Kód: Vybrať všetko
#define STLAC_POT PTB_PTB0 //potvrdenie
#define STLAC_MIN PTB_PTB1 //minuty
#define STLAC_SEK PTB_PTB2 //sekundy
DDRA = 0xFF;
DDRB = 0x00;
int min;
min = 0;
int sek;
sek = 0;
int potvrdenie;
potvrdenie = 0;
while(potvrdenie == 1){
if(min == 100){
min = 0;
}
if(STLAC_MIN == 1) min++;
if(STLAC_POT == 1) potvrdenie = 1;
}
potvrdenie = 0;
while(potvrdenie == 1){
if(sek == 60) {
min++;
sek = 0;
}
if(STLAC_SEK == 1) sek++;
if(STLAC_POT == 1) potvrdenie = 1;
}
//autoeditácia príspevku ( 27 Sep 2008, 14:20 )
ale mam asi taky pocit ze tym ze ked to zmacknem a ten cyklus ide asi trochu richo tak ono to asi bude pripocitavat dovtedy ako drzim tlacitko ?:D to by mi do napr sek zadalo asi take dlhe cisielka ne