Graphics: Multiple Histogram
The new gMultiple is very close to the gHistogram graphic except that it can display up to four series.
The gMultiple is a class and contains, apart from the constructor, two functions: dDefine and draw.
The example shown on the right display the yaw, pitch and roll angles provided by an inertial measurement unit.
Definition only requires
gMultiple myMultiple; // variable
20, 15, myLCD.maxX()-40, myLCD.maxY()-20-45,
"yaw", -180, 180, blueColour,
"pitch", -90, 90, greenColour,
"roll", -90, 90, redColour,
".", 0, 0, 0x0000,
0, 4, 0, false,
blackColour, whiteColour, yellowColour);
and update is as simple as
myIMU.YawPitchRoll(ypr, ypr, ypr); // get yaw-pitch-roll
myMultiple.draw(ypr, ypr, ypr); // display yaw-pitch-roll
void dDefine defines an multiple graphic with the following parameters:
Optional parameters for other series with default values
Optional parameters with default values
All those parameters work the same way they do for gHistogram.
void draw(float value1, float value2=0, float value3=0, float value4=0); updates the graphic with the values for each series.
When lapse is set to 0 (default), all values are displayed and there's no control of the period.
When lapse is defined (>0), the period of time between two consecutive measures is monitored: