Bit Mask Shifting Code Help

Status
Not open for further replies.

Suraj143

Active Member
I have connected 12 LEDs to my PIC ports.Lower 8 LEDs on PORTB & upper 4 LEDs on PORTA.I want to do a pattern like this...!!

First all the LEDS are lights up.After only the MSB LED shift left until it dissapered.After the next MSB LED will shift left until it dissapered like wise until last LED shifts and dissapered.For easy understand I have attached a picture of my pattern.

Did a code but it looks like too long.I need a compact code with lesser program lines.I use a baseline PIC16F54 (which has few programing space).
 

Attachments

  • Pat Anim.jpg
    55.6 KB · Views: 165
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…