Search found 5 matches
- Tue Apr 14, 2020 6:37 am
- Forum: General Discussion and Questions
- Topic: [SOLVED] Need help to change icon on LED matrix with serial input
- Replies: 6
- Views: 5313
Re: [SOLVED] Need help to change icon on LED matrix with serial input
One more thing: Since I asked same question on another site, same time as here, now I answered my question there and included link to this thread. I also gave credits to people who helped me here. I hope this is ok, didn't found anything regarding that here on mycropython forum FAQ and sorry if I mi...
- Tue Apr 14, 2020 4:21 am
- Forum: General Discussion and Questions
- Topic: [SOLVED] Need help to change icon on LED matrix with serial input
- Replies: 6
- Views: 5313
Re: Need help to change icon on LED matrix with serial input
Three things: - readline returns None if there's no input, otherwise it returns the input line. - When there is input, readline will include the '\r' at the end of the line (use strip to remove it). - As already pointed out, readline returns "bytes" (not strings), so you need to compare to bytes (o...
- Mon Apr 13, 2020 11:05 am
- Forum: General Discussion and Questions
- Topic: [SOLVED] Need help to change icon on LED matrix with serial input
- Replies: 6
- Views: 5313
Re: Need help to change icon on LED matrix with serial input
I searched Google for above error TypeError: 'NoneType' object is not subscriptable And found this is because I have empty response from serial until joystick is connected. I.e. If I connect micro:bit first I have no input on serial until I not start python script on Ubuntu. From other side, python ...
- Mon Apr 13, 2020 3:52 am
- Forum: General Discussion and Questions
- Topic: [SOLVED] Need help to change icon on LED matrix with serial input
- Replies: 6
- Views: 5313
Re: Need help to change icon on LED matrix with serial input
I don't have a microbit, but I think the issue might be the comparisons. joystick = uart.read() should be returning a bytes object according to the docs , in which case comparing it to strings (e.g. "1") would never be equal. One suggestion: since you're sending bytes objects ending with a newline ...
- Sat Apr 11, 2020 11:58 am
- Forum: General Discussion and Questions
- Topic: [SOLVED] Need help to change icon on LED matrix with serial input
- Replies: 6
- Views: 5313
[SOLVED] Need help to change icon on LED matrix with serial input
Hi guys. I am not a dev, just trying to make things working as I want. Cannot understand this: From one side, this is my python script on Ubuntu PC which sending button inputs from Playstation 4 joystick to serial port of micro:bit (joystick is connected to Ubuntu via bluetooth): import serial impor...