I'm doing a project where I'm sending data serially from Python to Arduino to control a robot. The
code is working and all; However, I want to try and send the data to Serial 2 instead of standard Serial. I
fail to see how that is possible. Any help would be highly appreciated.
Here is part of my python code:
import socket import serial arduino_port = 'COM4' #functions: def check_arduino_connectivity(): global connected, count, ser connected = False count = 0 # help execute the print statement in serial.SerialException only once. while connected == False: try: ser = serial.Serial(arduino_port,9600) # establish serial connection with Arduino print("Arduino Connected!") connected = True count = 0 except serial.SerialException: # if arduino is not connected: if count == 0: print("Arduino is not connected to port. Please connect it to proceed") connected = False count = 1