by one day, and posts it to the plot start time date entry
field at the lower right. It also retrieves the previously used
start time from the Uno’s EEPROM and restores it to the
start time field.
The need for flushBuffer(): Misinterpretation of data
and commands in the serial communications queue
between the Arduino and MakerPlot can happen. You
must ensure that the queue is empty before the Arduino
initiates a transaction.
That is the reason for the frequent use of flushBuffer()
that you see in these examples and in the downloaded
source code. See page 108 in the MakerPlot User’s Guide
for more information.
Building Your Own MakerPlot User
It is possible to start from scratch and build your own
user display utilizing MakerPlot control objects, but I don’t
recommend starting there.
Consider that an .spm file is to MakerPlot like an .xls
file is to Excel (or like a .doc file is to Word). It is the data
file that MakerPlot uses to build the control surface display
you see on your screen. The .spm file is an ASCII text file
and can be examined with Notepad.
All of the MakerPlot example user interface screens
can be found at C:\Program Files\MakerPlot\Macro
\interfaces as .spm files. To use one of them as a starting
point for your personalized display, go there and copy (for
Arduino work area. You should rename it also, but make
sure you keep the .spm file extension. I suggest you put it
in a MakerPlot folder under
your Arduino folder.
Double-click your copy
of the file and it will open in
MakerPlot. To free up a small work area, reduce the size
of the plot grid. Open the Object editor (second button
from the right on the toolbar) and set the Plot Percent to
50% in the X direction and 80% in the Y direction
(Figures 10 and 11).
Time to experiment!
1. Drag a control (e.g, a meter) from the Controls 1 or
Controls 2 tab of the Object Editor to the recently freed
area of the display.
2. Once in place, shift-right-click to select it. Click the
left field in the Object Editor; then use the arrow keys and
shift-arrow keys to experiment moving the object.
3. In a similar manner, select the Height field and use
the arrow keys again this time to resize the object.
4. Give your control a more memorable name than
the one assigned by MakerPlot. Don’t forget to hit ENTER
to terminate your entry.
5. Take a test drive:
A. In the Object Editor — assuming your test object is
a meter — select the value property and try entering a few
different values to see it animate.
B. Assuming that worked, select
menu>View>LOG(Debug/Immediate), or click the fourth
button from the right end of the toolbar and enter the
following command at the bottom (assuming the object
name was kMeter):
!POBJ kMeter.value = 25.
C. We’re on a roll! Let’s try to write a simple sketch to
ramp the meter up and down. Put the following code in
the setup() section of a new sketch and leave loop()
FIGURE 11. Shrink the plot grid
to make room for more
48 August 2017
FIGURE 10. Uncover a hidden experimental area behind the plot grid.