I am using GP17 and GP16 as Rx and Tx connected directly to the HC-05 Tx and Rx pins (cross connected)
I am powering the HC-05 with 5V from the Pico Vbus pin.
I have a voltage trimpot divider on the HC-05 pin Tx pin to make sure the voltage stays under 3.3V.
I am connecting to the HC-05 with Android SerialBluetooth app and sending "XXXXX" with carriage return and new line.
Code on my Pico running in Thony on Windows 10
But it just isn't working. There is not data received in Thonny.
With Arduino all this (with equivalent C) just works.
So what am I missing with Pico and micropython?
from MotorControllerLibrary import *
from machine import UART, Pin
import time
# enable GP2
# in1 GP3
# in2 GP4
# enable GP6
# in3 GP7
# in4 GP8
serial = UART(0, baudrate = 9600, tx = Pin(16), rx = Pin(17))
while True:
if (serial.any == True):
strCommand = serial.readline()
print(strCommand)