Printing status(value) of pins assigned digitalwrite

I have a project controlling many solenoids. In the code there var assigned to provide digitalwrite values. To assist in coding and debugging timing and sequences I would like to serial.print the values. I'm looking for the actual value writing to the pin. Any help would be greatly appreciated.

If this is an avr based board (e.g. uno or mega), you can read the (output) pin with digitalRead.

Here’s a macro I find useful

#define bin(x) {for(byte i = 0; i < 8; i++) print(getBit(x, (7 - i)));}

Call with ‘x’ replaced with any port/register/byte/char and ‘print’ with whatever print function you use (with no \n)

DKWatson:
Here’s a macro I find useful

#define bin(x) {for(byte i = 0; i < 8; i++) print(getBit(x, (7 - i)));}

Call with ‘x’ replaced with any port/register/byte/char and ‘print’ with whatever print function you use (with no \n)

I would take a single instantaneous copy of the target, then print that.

Got all the pins reporting!! Thank you all very much