Read 8 pins in parallel into a byte

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
andor8
 
Posts: 2
Joined: Mon Jan 30, 2023 5:57 am

Read 8 pins in parallel into a byte

Post by andor8 »

Parallel port on CLUE. On the Arduino UNO I can read the value of all 8 pins for port B by using the defined PORTB (int dataB = PORTB;). How is a similar operation possible on the CLUE?

User avatar
andor8
 
Posts: 2
Joined: Mon Jan 30, 2023 5:57 am

Re: Read 8 pins in parallel into a byte

Post by andor8 »

.. and to clarify - that is programming the CLUE in C using Arduino IDE

User avatar
westfw
 
Posts: 2006
Joined: Fri Apr 27, 2007 1:01 pm

Re: Read 8 pins in parallel into a byte

Post by westfw »

It'd look like:

Code: Select all

    uint32_t port0Pins = NRF_P0->IN;
Beware that bits are relatively scrambled, and some of the are in NRF_P1 rather than P0

Locked
Please be positive and constructive with your questions and comments.

Return to “CLUE Board”