Note that there are some explanatory texts on larger screens.

plurals
  1. POPlot an array into bitmap in C/C++ for thermal printer
    primarykey
    data
    text
    <p>I am trying to accomplish something a bit backwards from everyone else. Given an array of sensor data, I wish to print a graph plot of it. My test bench uses a stepper motor to move the input shaft of a sensor, stop, get ADC value of sensor's voltage, repeat. </p> <p>My current version 0.9 bench does not have a graphical output. The proper end solution will. Currently, I have 35 data points, and I'm looking to get 90 to 100. The results are simply stored in an <kbd>int</kbd> array. The index is linear, so it's not a complicated plot, but I'm having problems conceptualizing the plot from bottom-left to top-right to display to the operator. I figure on the TFT screen, I can literally translate an origin and then draw lines from point to point...</p> <p>Worse, I want to also print out this to a thermal printer, so I'll need to translate this into a sub-384 pixel wide graph. I'm not too worried about the <a href="http://nicholas.piasecki.name/blog/2009/12/sending-a-bit-image-to-an-epson-tm-t88iii-receipt-printer-using-c-and-escpos/" rel="nofollow noreferrer">semantics of communicating the image to the printer</a>, but how to convert the array to an image. </p> <p>It gets better: I'm doing this on an Arduino Mega, so the libraries aren't very robust. At least it has a lot of RAM for the code. :/</p> <p>Here's an example of when I take my data from the Arduino test and feed it into Excel. I'm not looking for color, but I'd like the graph to appear and this setup not be connected to a computer. Or the network. <a href="https://www.sparkfun.com/products/10438" rel="nofollow noreferrer">This is the ESC/POS printer, btw</a>.</p> <p><img src="https://i.stack.imgur.com/nnndx.png" alt="plot of sensor data"></p> <hr> <p><strong>Update:</strong> I have figured out the answer but haven't answered myself yet to share with the community. If you're here trying to learn the same thing, please email me off my profile and I'll either answer here or you directly.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload