2

I want to send five potentiometer values (bytes) through ZigBee using Arduino. I stored the potentiometer values in five different variables (bytes) and used

Serial.print(pot1);
Serial.print(pot2);
.
.
Serial.print(pot5);

The problem is that, when I am varying the potentiometer values, in the receiver section it is coming as 49, 55, 57, etc. (always changing), instead of some constant value from 0-255. (I am using Serial.read() function five times.)

How can I fix this problem?

q

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user17151
  • 2,607
  • 3
  • 18
  • 13
  • Need a lot more information, such as the code you are using to read and write, along with the settings you have for the ZigBee? Cheers. – David K Apr 09 '13 at 21:57

1 Answers1

0

Well, when you are varying the potentiometers it stands to reason that you will be reading varying values as the change is happening AND your program is reading and sending the changing values.

What I understand from your question is that you only want a ONE value sent after a change. I interpret this to mean that as you are changing the potentiometers, the values should not be sent, but in stead the final value should be sent.

What is the final value? Only you can decide, but one way to define it is: If the last value read one second ago is the same value read now, then send that value. The timing can be anything you decide, 1 second, 1/2 second etc.

I would like to help you with code, but you submitted very little code, and I am not sure I understood what you meant. Please clarify your requirements.

user2019047
  • 749
  • 7
  • 10