I'm trying to achieve 2-way communication over USB (COM port) between Raspberry Pi Pico and Windows PC (Python). I'm unable to send from my PC to Raspberry Pi Pico nor the way back. Doesn't affect the LEDs on breadboard, nor messages get printed in terminal. Code for PC: import serial import time # open a serial connection s = serial.Serial("COM7", 115200) print(s) # blink the led while True: s.write(b"on\n") time.sleep(1) s.readline().strip() s.write(b"off\n") time.sleep(1) s.readline().strip() Code on Raspberry Pi Pico: import time from machine import Pin import sys led = Pin(0, machine.Pin.OUT) led2 = Pin(2, machine.Pin.OUT) led2.value(0) led.value(0) def led_on(): led.value(1) def led_off(): led.value(0) while True: # read a command from the host v = sys.stdin.readline().strip() # perform the requested action if v.lower() == "on": led_on() print("Turned on!") elif v.lower() == "off": led_off() print("Turned off!") What's the smartest way to debug code on the Raspberry Pi Pico? After acquiring the serial connection, standard print debug? Is there any way to use the sequence debugger in Thonny IDE? I've tried methods from both serial and stdlib libraries without result. For PC I'm using PyCharm, for Raspberry Pi Pico Thonny. After flashing Raspberry Pi Pico I'm disconnecting the serial and run the script in PyCharm with different interpreter. Continue reading...