That is the idea, but you do not need the pos +=1, set the for loop indexer to n < 7; and use the for loop indexer (n) in the bitRead function (see below).
Here is a demo that reads a character from the serial port and sends the ASCII character code out to an array of 8 pins.
// serial input basics Example 1 - Receiving single characters
// https://forum.arduino.cc/t/serial-input-basics-updated/382007
// set serial monitor baud rate to 115200 and line endings to "no line ending"
const byte pins[] = {2, 3, 4, 5, 6, 7, 8, 9};
char receivedChar;
boolean newData = false;
void setup()
{
Serial.begin(115200);
Serial.println("<Arduino is ready>");
for (int n = 0; n < 7; n++)
{
pinMode(pins[n], OUTPUT);
}
}
void loop()
{
recvOneChar();
if (newData == true)
{
for (int n = 0; n < 7; n++)
{
digitalWrite(pins[n], bitRead(receivedChar, n));
}
newData == false;
}
}
void recvOneChar()
{
if (Serial.available() > 0)
{
receivedChar = Serial.read();
Serial.println(receivedChar, BIN);
newData = true;
}
}