User avatar
coskukoz
Posts: 34
Joined: Sun May 31, 2015 4:01 pm
Location: Balıkesir, Turkey

Read Serial Monitor and Assign Values

Sat Apr 29, 2017 5:07 pm

Hello,

I was following this example here: https://www.instructables.com/id/Raspbe ... unication/

Everything is ok with this example.

BTW I am also using Python.

What I want? I want to send two different int variable from Arduino. Then I want to assign them to different variables on RPi. Like example below;

I want to send x and y values to serialMonitor.
Arduino:
x = 10;
y = 20;

I want to assign this values to a and b on RPi
Raspberry Pi:
a = x
b = y
print("a = %d".a)
print("b = %d".b)

(my code is just an example.)
cactiapps.blogspot.com

Return to “Beginners”