display_overlay — Control the 7-segment display
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 |
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() . |
No value is returned.
#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); }