WOW Acetronics....
You are so cool!
Completely works...wow...in just one line you have set 3 lights from PortB to light up...Code:Make PortA and PortB's 0~2 lights up. PORTA = PORTA | %00000111 PORTB = PORTB | %00000111 Make PortA and PortB's 0~2 lights Down. PORTA = PORTA & %11111000 PORTB = PORTB & %11111000
It suddenly makes this whole "High PortB.0" look barbaric!
I don't exactly know "How" you set it, but I did try to experiment, I went ahead and try to make the light goes from the outside two lights to the inside one light, basically:
But me...trying to "copy" your way, not knowing what I am doing, do this:Code:High PortB.0 High PortB.2 Low PortB.1 Pause 500 Low PortB.0 Low PortB.2 High PortB.1 Pause 500 Low PortB.0 Low PortB.2 Low PortB.1 Pause 500
Let's just say the lights acted weird, I have no idea what "|" in the code does either than it's probably "Or" ?Code:PORTA = PORTA | %00000101 PORTB = PORTB | %00000101 Pause 500 PORTA = PORTA & %00000010 PORTB = PORTB & %00000010 pause 500
Not to mention "&" either than C's "And" ?
But they are single and not in pairs...some sort of bit shifters ?
Must trying to understand this concept...one line to control all Port Outputs....so powerful...but so mysterious to me...
Anyway thanks Acetronics, I use a 470 ohm for the LEDs under +6V![]()




Bookmarks