Ach so, d.h es leuchtet exklusiv immer nur eine, soso.
Na, dann mach dir LEDS on/off ein Byte mit "1" for ON und "0" für off
Geht sicher auch eleganter, aber im Prinzip sollt' das gehenCode:CONST LED_1 = 1 CONST LED_2 = 2 CONST LED_3 = 3 CONST LED_4 = 4 CONST LED_5 = 5 CONST LED_6 = 6 dim leds as byte ' LED -Status dim scan as byte ' zum refreshen dim Row as byte ' zum refreshen dim col as byte ' zum refreshen '--------------------------------------------- Initialize col = 64 ' column &B01000000 row = 8 ' row &B00001000 scan = 1 '--------------------------------------------- im Programm setzen/löschen leds.LED_1 = 1 ' led 1 ON leds.LED_3 = 1 ' led 3 ON leds.LED_1 = 0 ' led 1 OFF '----------------------------------------------- Refresh: (Timer) if leds.scan = 1 then PORTB = col OR row ' LED on ? else PORTB = 0 ' LED off end if incr scan ' next if scan = 7 then ' loop ? scan = 1 col = 64 else if scan > 3 then row = 4 shift col, right, 1 else row = 8 shift col, left, 1 end if end if







Zitieren

Lesezeichen