Hi..
I have a problem w/ uart microbit's V2 uart.
This simple test code works fine w V1.5 but i get error 11 with V2 at line "Buf_Uart=uart.read()" or "uart.readinto(Buf_Uart)" :
from microbit import *
Buf_Uart=bytearray(20)
Entete_Trame ="ABCDE"
while True :
if uart.any() :
#Buf_Uart=uart.read() #error 11
uart.readinto(Buf_Uart) #error 11
if chr(Buf_Uart[0]) in Entete_Trame :
print ("Bien recu : ", chr(Buf_Uart[0]))
if chr(Buf_Uart[0])=="F" :
Pitch_Consigne= 1
elif Buf_Uart[0]=="B" :
Pitch_Consigne= -1
elif Buf_Uart[0]=="A" :
Pitch_Consigne= 0
else :
print ("Hors trame :", chr(Buf_Uart[0]))
Is there something wrong in my code?
Tanks