The text method
As great as a spiffy graphical display is, it often makes sense to have some more specific
information displayed about a parameter's current value as well.
This is where the text
method comes in handy (using the font
we drew up earlier). Let's say, for instance, we want to have incoming CPS shown as a numeric value.
Then, we would have to add the following section:
What this does is display the rx_cps
parameter of cFosSpeed
keeps track of the current CPS reception rate.
By setting method
we make sure the disp
section uses the font we've already defined in step two.
is set to "d" (=decimal) with one digit after the comma.
Setting the "r" flag will have the text right-aligned.
Numeric value and measuring unit may take up to 6 digits
Seeing then how our font
definition clearly specifies each digit to have a
of 5 and a height
of 8 pixels, this would
result in a rect
pixels to be placed above the bar defined in [disp3]
Having the unitchar
point to a "blank" character bitmap
will prevent displayed numbers from shifting to the right when there is no measuring unit available.
This happens when transfer rates fall outside available
(T)era, (G)iga, (M)ega or (K)ilo byte ranges (e.g., when showing bytes only).
shifts the color of the text from yellow to orange,
decreases the intensity of the drop shadow, which is also part
of the font bitmap.
For outgoing CPS, let's now add the following:
It should be obvious by now that this is basically the same as above – just with other
coordinates. What's also different here is that the transform1
the color to green, while transform2
creates a slightly darker shadow.
Next step: Adding an LED with the slider method
The history method
The slider method