Are you trying to transfer data to another Arduino via the Serial Monitor? You might use Serial.write() to talk to a device that understands binary data, but you use Serial.print() to talk to the Serial Monitor.
For each 4 bit binary data received , it executes a certain routines such controlling the speed of motor or brightness of led,
Serial data is one byte/8 bits long. You can not send just 4 bits. What is the significance of sending a binary value, anyway? The receiver still has to compare the received value against all possible values.
int val = Serial.read();
switch(val)
{
case 0b0000: Do0(); break;
case 0b0001: Do1(); break;
case 0b0010: Do2(); break;
case 0b0011: Do3(); break;
case 0b0400: Do4(); break;
}
will be no faster than:
int val = Serial.read();
switch(val)
{
case '0': Do0(); break;
case '1': Do1(); break;
case '2': Do2(); break;
case '3': Do3(); break;
case '4': Do4(); break;
}
The second set of values looks reasonable in the Serial Monitor, too. The first set of values does not.
The character data, since it is one byte long, transmits in the same length of time as the byte value.