Demos don't work because of error in script
mgorbet opened this issue · 3 comments
mgorbet commented
Script uses "baudrate: 9600" but should be "baudRate: 9600" - when updated, this works on Chrome Version 86.0.4240.80 (Official Build) (x86_64)
Error is easily resolved but should be fixed in repo.
TitanShan commented
Thanks for posting here, been looking for fix.
UnJavaScripter commented
Thanks @mgorbet for sharing and @TitanShan for making this appear on my notifications again. I've been away from my GH but it's time to come back. I updated the code a little bit and will continue polishing it soon.
Anything you'd like me to add? or maybe you can improve it yourselves.
mgorbet commented
Actually absolutely - there was an issue I had just yesterday that cost me about 4 hours of scratching my head:
I was using your "write()" command to send commands to my microcontroller, and it was all fine when I was sending strings, but as much as I tried to send raw bytes, it didn't work.... I was so flummoxed but eventually found in your code that you use the "encoder" and pass all output through there to turn it back to strings! So I made a new function called writeBytes() that skips that step and writes the raw bytes. It was SO frustrating, and I realize partly because the Arduino serial libraries use print() for string-conversion and write() for raw bytes. SO... you might consider creating a "print()", and "println()" function that act like the Arduino ones -- convert to string, and add a line break with println -- and keep 'write()' as being just the raw bytes.
Hope this is helpful.
Thanks so much for making it easy to work with the web-serial framework.
<M>
…-----------
Matt Gorbet
matt@gorbetdesign.com
On Wed, Feb 24, 2021, at 4:36 PM, Diego Coy wrote:
Thanks @mgorbet <https://github.com/mgorbet> for sharing and @TitanShan <https://github.com/TitanShan> for making this appear on my notifications again. I've been away from my GH but it's time to come back. I updated the code a little bit and will continue polishing it soon.
Anything you'd like me to add? or maybe you can improve it yourselves.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AACHUUYLOASVGGLZHL4MU23TAVWNLANCNFSM4SPWTE5A>.