I am using a Raspberry Pi (Revolution Pi by Kunbus) to control multiple arduinos via serial communications (usb). I wanted to know if it was possible to control/communicate with multiple serial ports at once. I know multi serial aruduinos, such as the MultiSerialMega, allow for you to list Serial.begin(9600); and Serial1.begin(9600); to communicate with multiple at once, does this exist on the Raspberry Pi? As it stands I switch ports but the program running on the other arduino stops as soon as I do so.
To summarize: Can I sommunicate with three serial ports in python such as in the MultiSerialMega?
Thanks, Levi
I've tried just adding a one, like the example for the MultiSerialMega, but that does not work (not surprisingly)
import serial
import time
while True:
ser = serial.Serial("/dev/ttyACM0")
steps = int(input("How many steps?")
ser.write(b'%d' %steps)
ser = serial.Serial("/dev/ttyACM1")
steps = int(input("How many steps?")
ser.write(b'%d' %steps)
I am just playing around with stepper motors at the moment, but as soon as I switch serial ports the program ends/motor stops moving.