Hello!
I am working on using HC05 modules to connect a flex sensor to a servo motor. I can send values fine if I just write 0-180, but when I read the flex sensor and map it, it prints weird symbols before the data. I tried changing the baud rate but it didn't change anything. The code and sensor themselves work fine, it just is messed up when I send it over Bluetooth.
My question is - what is this symbol? Is there anyway to have the data send better?
Thank you!
Hi, yes that is the circuit from the tutorial since I dont have my own diagram but I am using a Uno. I have them programmed and connected, and the bluetooth works fine, I can send a command on one board and it moves the servo on the other. it is only when I try to send my sensor value that it adds those symbols and doesn't work. Do you know what those symbols are? its when I print the rawValue/analogreading.
If you are using a Uno then it is not a good idea to use pins 0 and 1 for the HC-05 as they are used by the Serial interface. This will prevent printing debugging information to the Serial monitor and can interfere with uploading sketches
You should consider using SoftwareSerial on 2 other pins of your choice
Another observation. analogRead() will return a value between 0 and 1023 so rawValue could be between 0 and 1023 but your mapping does not take this into account
If yo were not using pins 0 and 1 then you could print what analogRead() was returning to check its value
Okay thank you! I will try using SoftwareSerial and see if that works.
The mapping is because we are working with making textile flex sensors so it filters out the noise and those are the values I got from fully extended to fully retracted.