putting all outputs high

HI, I JUST HAVE A QUESTION, IS THERE ANY WAY TO WRITE AN ENTIRE BYTE ON THE OUTPUT PORT OF ARDUINO

I MEAN, WITH DIGITALWRITE, i only can write a bit on the desired output, but what about if i want to set to 1 all arduino output

example, if i writing FF i want to put all outputs high without writing bit by bit, but i cant find a way to do that

the only way i know is this digitalwrite(1,high) digitalwrite(2,high) etc thanks

Why SHOUT?

Byte-wide ports are rare on the Arduino but you need to look at direct port manipulation

You could use a for loop to set a contiguous range of pins HIGH:

for(byte b=3; b<14; b++)
{
   digitalWrite(b, HIGH);
}

direct port manipulation

example

PORTB = B00111111;

will set all pins on PORTB (dig 8-13) high at the same time, but this is not portable, ie the same code won't work on a Mega.


Rob

Graynomad:

direct port manipulation

example

PORTB = B00111111;

will set all pins on PORTB (dig 8-13) high at the same time, but this is not portable, ie the same code won't work on a Mega.


Rob

Assuming you have previously set the data direction register....

Don