-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Printing to serial from pd patch #21
Comments
Is there already a method for printing to serial in libDaisy? Then we simply need to add a printHook() function to the Heavy context that uses this. From what I can tell this would be done via the |
Only thing is there is some noise appearing on the oled of my Field, but I'm sure there is some tricks to suppress that. |
@stephenhensley Is this something you think we should enable by default or should there be a flag in the board json to enable it? |
Ah and we can simply address these functions as I just need an OK for the |
Nevermind, I was not doing my manual commands right and didn't flash the bootloader correctly. |
Exciting stuff! I'm not sure if it should always be on or not. Also, FWIW it may simplify things (or it may not) to know that there are some template static class methods for the Logging class that might be useful in this context, although all of the existing Daisy SOMs do currently have a logger method with wrappers. So your approach should work as is. e.g. daisy::Logger<LOGGER_INTERNAL>::StartLog();
daisy::Logger<LOGGER_INTERNAL>::PrintLine("Hello World"); Only other thing to keep an eye on is printing float values. There's a section at the bottom of this page in the libDaisy docs that covers the three ways to deal with that with the logger class. |
@stephenhensley Well .. nearly! I actually don't know anything about C++ templates so I don't think this makes it any easier for me ;) Trying a simple patch to send a number, which should come in as characters via |
Relevant code that is used to send the print and format the message: |
@stephenhensley Ah yes, if I add This does increase program memory slightly, but I expect the vast majority of programs to want to use size optimized builds anyway to be honest. |
I've updated the PR to make this optional from the meta file. We can then add a flag to the plugdata compile dialogue where the user can enable such "debug printing" when they require it. |
Requested feature, and an interesting one at that.
Not sure how we'd manage any string formatting that goes a long with it, but if pd messages work like max messages than we could just parse the messages as strings and schedule them for output periodically.
The text was updated successfully, but these errors were encountered: