Pins as Byte

Hi there,
Is there a simple way to make 8 Pins behave as a byte?
Like B00110011 would make go the pins 0 to 7 HIGH and LOW according to their bit state?

Arduino Reference - Arduino Reference :slight_smile:

i have seen that - but i got it that only those 'pre fabricated' arrays of pins work.. is there a way of defining one's own array and (like DPin0 .. Dpin3 and Dpin8 to Dpin12) assigna byte to those?

i have seen that - but i got it that only those 'pre fabricated' arrays of pins work.. is there a way of defining one's own array and (like DPin0 .. Dpin3 and Dpin8 to Dpin12) assigna byte to those?

Well.

You can not define your own array, and expect it to behave as a direct port.
(This is because you can not operate on a bit in a byte, you always operate on the entire byte.)
[edit]What I kind of meant to say is that the bit has no adress, only the byte has. Because of this you can not 'point' to a bit in a byte.[/edit]

You can, of cource, create a byte that will represent the states, and that need some processing to get to function.

bitRead and bitWrite will be useful.