Menu

#40 pyDarts doesn't seems to support line breaks

1.0
open
nobody
None
2023-07-20
2023-07-20
SamTi
No

Hello, I'm trying to build cross-software hardware to be able to use various software with "augmented" electronic targets. So I have to find a common way to send serial data to COM port that most software accept.

In example OpenDarts needs line breaks and maps the string (one or more char) to a dartboard zone, or to a special function. So I replaced the Serial.print(key);in the arduino code by Serial.println(key); . This way it adds a carriage return character (ASCII 13, or '\r') and a newline character (ASCII 10, or '\n').

I was able to calibrate the dartboard in pyDarts with this change, but when I try to play, I get this error in the console window each time I throw a dart : Error 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

This seems strange to me to successfully calibrate the board then failing to play, and what is the link with a potential utf-8 conversion ? It should only read chars and compare with the ones recorded in the calibration map, and skipping or resetting while finding a carriage return or a new line.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.