from machine import UART,Pin
from time import sleep ,sleep_us
p = Pin(4,Pin.OUT)
p.on()
# uart = UART(2, 9600) # init with given baudrate
# uart.init(9600, bits=8, parity=None, stop=1) # init with given parameters
#start bit LOW
p.off()
sleep_us(40)
#Data
p.on()
sleep_us(40)
p.on()
sleep_us(40)
p.off()
sleep_us(40)
p.off()
sleep_us(40)
p.on()
sleep_us(40)
p.on()
sleep_us(40)
p.off()
sleep_us(40)
p.off()
sleep_us(40)
#Porarity
p.off()
sleep_us(40)
#Stop Bits
p.on()
sleep_us(40)
# for _ in range(3):
# p.on()
# # uart.write('abc') # write the 3 characters
# sleep_us(4000)
# p.off()
# sleep_us(4000)