FIGURE 8. A simple text box shows which of the machine's
four states (IDLE, COUNTDOWN, PLOTTING, STOPPED) is current.
Height) can be manually changed, but it is more likely you
will use your mouse to move and resize the object. Select
one of these four fields with a mouse-click first; then use
the arrow keys to move or resize the object.
FIGURE 7. This meter is a typical MakerPlot control object. Each
has a set of object properties and a unique name.
Sixteen object properties/functions/values are listed
for this meter and are read/write accessible to Arduino
code (must scroll to see them all). Three of the 16 are
used in this project: Value which is updated once during
every loop() scan; and Max and Label which were
configured and saved when the display was originally
built. The code fragment which is used to update this
meter and also the plot is:
Serial.println(F(“!SPAN 0, 5.0”));
// service the plot grid and meter
float v1 = (5.0 analogRead(A0))/1024;
// Bare numeric values like this go directly
// to the plot
// Update the meter
Serial.print(F(“!POBJ voltMeter.value = “));
Serial.println(). Other previous substrings will use
Serial.print(). See the example shown under Plot Grid.
Example of an Arduino command sent to MakerPlot:
(e.g., Reset Plot, Label Y Axis, Stop Plotting). These
commands are prefixed with a ‘!.’ A complete listing of
MakerPlot commands can be found in the MakerPlot User
Guide (Section 15: Control instruction Summary; see
Resources) Examples are:
Note the use of print() vs. println() in the last line
above. Very important!
Example of Arduino sending an update to a
Another example of MakerPlot object update coding
is the fragment below where the red IDLE status text
display (Figure 8) is updated to instead show a blue
COUNTDOWN system state indication.
MakerPlot Control object: For instance, updating a meter
to move its pointer from its current position to “74” on the
meter scale, or to display a switch in the ON rather than
Only four properties are available in this text object
for updating by the Arduino, and we will use three of
OFF position. The meter shown in Figure 7 is typical. In
this case, the object name voltmeter was manually
assigned, but if the developer chooses not to assign one,
MakerPlot will assign its own unique identifier.
The four numeric coordinates (Left, Top, Width, and
Serial.println(F(“!POBJ sStatus.Back Color =
9”)); // Blue
Serial.println(F(“!POBJ sStatus.Text Color =
15”)); // White
Serial.println(F(“!POBJ sStatus.Text =
This is very similar to the voltmeter example above. A
46 August 2017