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
definition 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
, which 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 width
of 5 and a height
of 8 pixels, this would result in a rect
of 30x8 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, transform2
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 rect
coordinates. What's also different here is that the transform1
key changes the color to green, while transform2
creates a slightly darker shadow.
Next step: Adding an LED with the slider methodThe history method The slider method Index