Subscribe:

Ads 468x60px

Sunday, August 7, 2026

Arduino and Python

          Pairing Arduino with Python is a great way to build projects. You can send data serially from the Arduino to Python, and to receive that serial data Python provides a module called pyserial. Working with the pyserial module is straightforward.




Reading data from Arduino

>>> import serial
>>> ser = serial.Serial('/dev/tty.usbserial', 9600)
>>> while 1:
...             ser.readline()
Sending data to Arduino is just as simple:

>>> import serial
>>> ser = serial.Serial('/dev/tty.usbserial', 9600)
>>> ser.write('data')

Here are a few links related to pyserial and Arduino



0 comments:

Post a Comment