Prop Backpack overlay question
Seeker
Posts: 58
I am using the Prop Backpack as a standalone board to read a few sensors and overlay the variables and some text on a screen with a live video feed. I can get the overlay to work fine if I am outputting strings, but I can't figure out how to output an integer variable (bytes, words and longs). I have read through the docs and through posts in the forum but can't seem to find the info.
Of course the search function in the forum is not the best so I might have missed it.
But I swear I have looked... so now I am asking... is there a way to display variables when using the Prop Backpack as a standalone board to overlay onto a video source?
Thanks!
Of course the search function in the forum is not the best so I might have missed it.
But I swear I have looked... so now I am asking... is there a way to display variables when using the Prop Backpack as a standalone board to overlay onto a video source?
Thanks!
Comments
John Abshier
I wasn't sure if there was something in the built-in code I could use... I had a feeling there wasn't. But numbers.spin sounds like it will do the job.
And thanks for the quick answer. Now I just have to do a bit of preening to keep the memory footprint down, or compile with BST...
You should be able to use a "Dec" method from one of the serial objects to output numbers.
Here's PST's Dec method adapted for the Backpack.
Just paste the above method into the overlay object. I haven't tested it but I'm bet a QuickStart label it works.
It assumes there's a method "print" that allows characters to be displayed on the overlay. The above code should also work if the method "out" is used instead of "print".
Actually, this was my original fallback plan... or something similar. I had looked at the PST code briefly and thought I could adapt it if I had to.
I will try both and see what works best.
Thanks again to both of you!
And I am still open to any other suggestions if anyone has any. One thing I have learned is that there are many ways to accomplish the goal. Half the fun is finding the one you like best. And it is a GREAT learning experience.
Numbers.spin seems like the best bet for me. I like that I can alter the format for larger numbers, and since I will be adding a GPS, this will come in handy. The only problem is it comes with a lot of "baggage". But in BST I can save 256 longs. If I edit it I am sure I can get that in the Prop tool too.