2

i have a BGM113 bluetooth module that sends messages as binary form. I have to work on each bit separately. i am not sure about Serial.read() gets it as binary but when i am trying to see at on the serial port screen with Serial.println(Serial.read(), BIN) it shows me as string something like []...[] What should i do ?

3
  • A byte is 8 bits. You can use "bit manipulation" to extract or set single bits. A very good tutorial here: (avrfreaks.net/forum/…) Commented Jan 19, 2017 at 11:33
  • 1
    There is a difference between binary form and base 2 (BIN) number conversion. Commented Jan 19, 2017 at 12:09
  • Serial.read() reads a byte (8 bits) so you should receive 8 bits at a time. If there is some form of flow control then you might just get 1 bit. It looks like you are not getting any bits so check your code is waiting until data is available. Commented Jan 19, 2017 at 13:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.