Read 8 pins in parallel into a byte
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- andor8
- Posts: 2
- Joined: Mon Jan 30, 2023 5:57 am
Read 8 pins in parallel into a byte
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?
- andor8
- Posts: 2
- Joined: Mon Jan 30, 2023 5:57 am
Re: Read 8 pins in parallel into a byte
.. and to clarify - that is programming the CLUE in C using Arduino IDE
- westfw
- Posts: 2009
- Joined: Fri Apr 27, 2007 1:01 pm
Re: Read 8 pins in parallel into a byte
It'd look like:
Beware that bits are relatively scrambled, and some of the are in NRF_P1 rather than P0
Code: Select all
uint32_t port0Pins = NRF_P0->IN;
Please be positive and constructive with your questions and comments.