Question on port I/O - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Question on port I/O

Hey everyone,
I was wondering if there was a way to cycle through the individual bits of a port without having to write each one out individually
i.e. P1.0, P1.1..etc.
I need to light up some LEDs and just wanted to save myself from lengthy code. I'd be particularly interested in some sort of "variable" I could define to equate to each bit like say P1.port and then just increment port. Thanks
Sign In or Register to comment.