Hello i have establish a project. I ama using arduino uno andHello, I set up a project. I use Arduino uno and hc-05. I can easily send data for LED control. However, when I want to receive data between (0-1023) potentiometers, I see negative values. 0-125 is ok, but after that, negative values come. I can't read 2-byte values on the screen without a negative value.
Shown below my programs.
Dear @Oner_TAN,
please remember that if you receive a "signed" byte the, 8th bit (bit 7 starting from 0) is the sign bit. Therefore your byte value range is between +127 and -128. Or, with a two bytes value the 16th bit, (i.e. bit 15) is the sign bit, therefore the value ranges between +32767 and - 32768.
In other words, if your most significant bit is set to "1" the resulting number is negative.
You'd better send and receive unsigned bytes or text, instead of numbers, and let the AI2 app to convert them.
Hoping this helps.
Cheers.
Hello,
thanks for your reply.