pylon:
This is not correct. If the argument to the print() method is a character, the character's value is directly transfered using the write() method. But the detour over the print() method is not necessary and might lead to future errors.Try using ser.read() instead of ser.readline() in your python script. And don't use print to put a byte value out as it will be made "printable" by converting it to hex format. If you have problem programming the Pi in python, go to a Pi forum. The Arduino code does what you told us you expect it to do.
pylon:
This is not correct. If the argument to the print() method is a character, the character's value is directly transfered using the write() method. But the detour over the print() method is not necessary and might lead to future errors.Try using ser.read() instead of ser.readline() in your python script. And don't use print to put a byte value out as it will be made "printable" by converting it to hex format. If you have problem programming the Pi in python, go to a Pi forum. The Arduino code does what you told us you expect it to do.
pylon:
This is not correct. If the argument to the print() method is a character, the character's value is directly transfered using the write() method. But the detour over the print() method is not necessary and might lead to future errors.Try using ser.read() instead of ser.readline() in your python script. And don't use print to put a byte value out as it will be made "printable" by converting it to hex format. If you have problem programming the Pi in python, go to a Pi forum. The Arduino code does what you told us you expect it to do.
Thanks for the reply.
"If you have problem programming the Pi in python, go to a Pi forum."
LOL, I did go to Pi forum. I went to one Pi forum, I got the same reply "If you have problem programming the Arduino, go to a Arduino forum. Reminded me that when I call Comcast, they send me to my router maker, when call the router make, they bounce me back to Comcast. Haha. Is there an ArduiPi forum to fill the gap? ![]()
Anyhow, as far as I concern, the int 180 is encoded in a single byte \xb4 in python presentation. I guess it is in 0x4b in C presentation. in python there is a utility function int.from_bytes(,,,) that converts a single byte back into int. Is there a similar function on Arduino?