#include #include /* æProfi 537 Port 5 mit EXBO LED-Reihe verbinden Port 5 ist auf CON5 Mitte rechts LED-Reihe ist auf ML2 vlnr. */ const unsigned char Bitmuster = 0x01; unsigned char Zyklus = 0x00; unsigned char Laufrichtung (void) { return ((P6 & 0x80)==0); } unsigned char Inkrement (void) { return ((P6 & 0x40)==0); } void ISR_timer0(void) interrupt 1 { TH0=0; TL0=0; Zyklus++; Zyklus%=8; if (Zyklus==0) { switch (Inkrement()) { case 0: P5=Bitmuster; break; case 1: P5++; break; } } switch (Laufrichtung()) { case 0: P5 = _cror_(P5,1); break; case 1: P5 = _crol_(P5,1); break; } } void main(void) { TMOD = 0x01; TH0=0; TL0=0; TR0 =1; EAL=1; ET0=1; P5 = Bitmuster; for (;;) { } }