79345858

Date: 2025-01-10 13:33:56
Score: 0.5
Natty:
Report link

When you initialize COM port (in Python) Arduino will restart. So, I suggest you try increasing time from 1ms to 1s by changing your code to:

import serial
import time

    arduino2 = serial.Serial(port='COM12', baudrate=9600, timeout=.1)
    time.sleep(1000)
    arduino2.write(str.encode("u"))

This additional time should be enough for Arduino Nano to restart and respond to serial communication.

Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): When you init
  • Low reputation (0.5):
Posted by: Nelson