Copy old LED state to accumulator, mask (ANL) lower 4 bits and rotate in one direction, mask upper 4 bits and rotate in another direction. Combine both results (ORL) and store it to LED port.Ok, now I'm using Assembly to perform a few actions in the uC.
My next challenge is to write a small and simple code to make the uC react to 4 control signals.
I have 8 LEDs connected to Port 1.
Te challenge is:
If P0.0 is "1", then all LEDs must turn ON and turn OFF
If P0.1 is "1", then one LED must turn ON and rotate left (RL instruction in Assembly)
If P0.2 is "1", then one LED must turn ON and rotate right (RR instruction in Assembly)
If P0.3 is "1", then the 2 middle LEDs must turn ON and one rotates left and the other one rotates right, so 2 LEDs will be working.
I have part of the code done and part of that part is working but the other part is not working.
But for now I need help to build the code to P0.3.
Any hits?