I received 120 bits data from real term to serial monitor, that received 120 bits data i want to split 8 bits 8 bits 8 bits like that , could you pls give me suggestion for how to do that............
8 bits is one byte
Read a byte, save it to an array
Repeat 15 times
The bits are in the array ready for you to use as you want
the serial protocol only sends bytes ... not bits.
sending 8 bit bytes is typical for about any data protocol.
if you are really intersed in the individual 8 bits in a byte then you can always break down a byte
after it is received using something like this:
something like this should work:
void setup() {
Serial.begin(9600);
}
void loop() {
while(Serial.available()){
byte b = Serial.read();
int i = 0;
while(i<8){
Serial.print(bitRead(b,i)); i++;}
}
}
if you explain what you're doing and why, we could be more helpful.
Jay002:
I received 120 bits data from real term to serial monitor, that received 120 bits data i want to split 8 bits 8 bits 8 bits like that , could you pls give me suggestion for how to do that............
Please elaborate. Realterm is a terminal program as is serial monitor. What am I missing?
You can have two terminal programs communicating but that does not necessarily have to involve an Arduino. So where does your Arduino into play?
PS 120 bits can be 12 bytes of data if start bit and stop bit are involved. And with a start bit, two stop bits and a parity it's only 10 bytes of data.