For character to byte I use ord() when reading serial port:
Rxdata = bytearray(256) #receive buffer, 0..255
...
rxc = U0.read(1) #return None if timeout
Rxdata[rxcount] = ord(rxc)
rxcount += 1
...
Search found 2 matches
- Mon Apr 04, 2022 8:31 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: Non-blocking stdin read performance
- Replies: 8
- Views: 4703
- Tue Mar 29, 2022 4:44 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: Timer callback stops with uart thread
- Replies: 0
- Views: 10388
Timer callback stops with uart thread
I am reasonably familiar with microcontrollers having worked since the 8051 came out in the 80's. However python is a new acquaintance, as is the RPi Pico. My little home automation project came to a halt when the timer isr (callback) stopped for some reason. a) when running the code and not enablin...