Site Tools
Sidebar
User's Manual
t2:display_overlay
display_overlay
display_overlay — Control the 7-segment display
Description
void display_overlay(uint8 mask, uint16 timeout);
Set, for an certain amount of time, the state on/off of each segment of the Titan Two's display, based on the bitmask mask.
Bit to Segment Map | ||||
---|---|---|---|---|
Bit Position | Bit Mask | Hex | Segment | Header |
0 | 00000001 | 01 | A | SEG_A |
1 | 00000010 | 02 | B | SEG_B |
2 | 00000100 | 04 | C | SEG_C |
3 | 00001000 | 08 | D | SEG_D |
4 | 00010000 | 10 | E | SEG_E |
5 | 00100000 | 20 | F | SEG_F |
6 | 01000000 | 40 | G | SEG_G |
7 | 10000000 | 80 | DOT | BOTTOM_DOT |
Parameters
- mask: Each bit correlates to a segment of the display, accordingly above table. Setting a bit makes the correlated segment to be lit.
- timeout: How long, in milli-seconds, the display should show mask. After the timeout, the display goes back to the state it had before call
display_overlay()
.
Subsequent calls of display_overlay() does not creates an stack of states, instead mask and timeout are always updated with the values from the last call of display_overlay() . |
Return Value
No value is returned.
Examples
Example #1 display_overlay() example
#include <display.gph> main { combo_run(CountDown); } combo CountDown { const uint8 disp[] = { 0, _9_, _8_, _7_, _6_, _5_, _4_, _3_, _2_, _1_, _0_ }; static uint8 i; display_overlay(disp[i], 1000); if(++i >= sizeof(disp)) i = 0; wait(0); wait(980); }
See Also
t2/display_overlay.txt · Last modified: 2017/01/29 06:17 by J2Kbr