Sending Arduino Serial print to Raspberry Pi

Hi
I’m new to the forum and fairly new to Arduino and need some recommendations. I have developed a sketch on my Arduino mega2560 which uses light sensors to time pinewood races and print race results to a TV using the TVout library. Everything is working fine except that the output is not formatted like I want. I have the Arduino talking to a Raspberry Pi 4 via Bluetooth and would like to use the Pi to present the data it receives from the Arduino in a nice format on the tv screen. Any recommendations on how to do that or recommendations on a better way?
Thanks

A simple way that might be sufficient is to use tab (\t) separation to create columns.

And alternative is to use sprintf / snprintf to create a formatted text and use that; advantage is that you will have full control over the format.

It's not clear to me if you want a solution at the Pi side or at the Mega side.

You should be able to achieve the above with just the Mega. If you share your code (please don't forget to use code tags as described in How to get the best out of this forum) somebody might be able to advise. It would be useful if you could provide an example of how you want it to look.

and

So I am not too sure what you are asking?

If you want the Pi to generate the video to the screen then I would (and have done many times) use the PyGame framework. That will allow you to have very nice graphics and text on your display.

This is an example of a screen I made from data from an Arduino into a Pi. The connection was through USB and not Bluetooth but that should not matter.

Note it includes radio buttons to select options as well.

Thanks for your help. The Arduino sketch I wrote simply Serial.prints race results (1st place, Time=3.134, Lane =4) on the serial monitor and TV (no video). When I print these results to the TV from the Arduino, the font/format looks like an old DOS screen. I know this is a limitation of the Arduino so, I want to send the results to the PI and have it format the results using HTML????

Much more elaborate than what I could do but yes, I have the arduino and pi talking via hc-05 Bluetooth module. I want to send from the arduino to the pi like you’ve done so that it looks a little more sexy. It’s just race results, no video.

OK I was trying to show off communications between the Arduino and the Pi, but I would still recommend the PyGame framework. It is a lot simpler than it seems and it has lots of examples so you can build things up as you go.

You can even include images of your pinewood racer, although I have never heard them call that, I imagine they are gravity fed free running carts. In the UK the names of such things are very geographically specific. Names I have come across include bogies , guiders and soap boxes.

Right. These are little cars about 8” long and run on a multi-lane track. The starting gate begins a timer and there are light sensors at the end of the track to capture elapsed time for each lane. My Arduino sketch is finished and I can display the race results on a TV but, the graphics need to be better. I bought the Raspberry Pi in hopes of receiving the results from the Arduino and displaying them on the TV in a nice format. I have the Pi receiving data from the Arduino via Bluetooth just not sure how to display it.

I did but it didn’t make sense

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.