Serial Input confused on type SOLVED

You typed in the char '1' so you must then read the char '1' not the number 1. Convert the char '1' to the number 1. Add

inByte = inByte - '0';

before your for loop.

Mark