I need to be able to set 4 pins in a single operation.
The only function I see, digitalWrite(), seems to only be able to do one at a time.
Is there a function that writes to the port rather than individual pins?
Thanks
Jim
I need to be able to set 4 pins in a single operation.
The only function I see, digitalWrite(), seems to only be able to do one at a time.
Is there a function that writes to the port rather than individual pins?
Thanks
Jim
Here you are
For example
DDRB = 0x0F; // set lower four bits of PORTB to outputs
PORTB = 0x0F; // set lower four bits of PORTB
Rob
But that only works if all the pins are on the same port.
I need to be able to set 4 pins in a single operation.
Why? In practice that is quite a rare request despite beginners thinking it is common.