How to create a low resolution video with data received from UART?

Hello,
I am planning to send data through the COM port to Processing to construct a low-resolution image based on the collected data. As it is being sent over UART, I assume that the refresh rate will be very low. My idea is to create different segments of 5x5 pixels. So if I have only 25 data points, the image will be 25 pixel based (each data point will be considered as an individual pixel). And I will only increase the number of data points by 25.

First, I thought of using the rect(a, b, c, d) function for each pixel and the fill(a) function to use the UART data as color. I wanted to use the 5x5 section to create two different loops. One will be called to draw the 5x5 pixel image and then, based on how many 5x5 segements I have, I’ll call the other function to add the other 5x5 blocks to different sides of the first block. My primary goal is to add at least four of those blocks.

And even just thinking about this process made me realize that it can be very slow. Is there any way I can make the process quicker?

Thanks

1 Like

Your idea seems sound. I would suggest that any implementation you choose to work out will help you define how “fast” or “slow” the code is. You can then see about ways of improving it.

It seems to me UART can run quite quickly, (Common values for baud rate are 9600, 1200, 2400, 4800 , 19200, 38400, 57600, and 115200 bps) it just depends how many calculations you wish to send per loop cycle from your arduino or from processing’s draw loop.

Share some of your code and members will jump in to help.

https://www.circuitbasics.com/how-to-set-up-uart-communication-for-arduino/

:slight_smile:

1 Like

Thanks. I have already completed the UART communication code. It seems to work. but still have not completed the design. If there is a speed-related issue, then I can use this example to see if there is any improvement.

By the way, is there some way I can select a thermal camera type color palette other than using RGB to fill the squires? I have seen fill() as the primary way to select color for an object.

Hello @onelectron,

Check out the resources (tutorials, references, examples, etc.) here:

The tutorial on Color and Images and Pixels and the the Color and Image sections in the references is a good place to look.

:)

1 Like

There are several ways to to select and designate colours.

You can also create your own palette by using the colour selector found in the top /tools menu.