The Value property controls the number shown on the display. Setting the Value property will cause the individual segments in the display to be set in such a way that they show the number assigned to the Value property. For example, If the value 11 is written, then segments B and C in both digits are turned on while the rest are turned off. Likewise, if the value 8 is written, then all segments except the Decimal Points are turned on. When the Value property is read it will return the last value that was written to it. Note that if the segments are manually changed (as described below), the Value property will not reflect the changes. Instead, the Value property will still read back the last value that was written to it. The Mode property specifies if the display will show decimal or hexadecimal numbers. Because the Value property can be read or written, it can be used in mathematical operations. For example, to increase the value displayed, the following code can be used (where D is the name of the o7Seg2 object.) :
D.Value = D.Value + 1
D.value++;
The Ones and Tens properties are instances of the o7Seg object witch provide the individual digits. Each of these objects are independently controllable. (See the o7Seg Object help page for more details) Each digit also contains the actual numeric value for itself. As noted above, when the Value property is written to, the segments required to display the value are determined and then the Segments property is set to the sum of those values. For example, If the value 12 is written to the Value property, then the two digits are split up and assigned accordingly to their respective displays. Each of the two digits also have segment data that allows the segments to be controlled on a bit by bit basis. Within the Segments property of the two o7Seg objects, each bit is assigned a name that specifies which segment that it controls. For example, the following code will turn on the "G" segment in the ones column.
D.Ones.Segment.A = 64
The Decimal Points are also controlled in this way. Note that unlike the other segments, the state of the Decimal Points are not changed when the Value property is written to. The IOGroup property specifies which group of 8 I/O lines is used to output the data to the segments. The I/O groups are 8 contiguous I/O Lines beginning at I/O line 8, 16, or 24. In each group, the first I/O line is considered bit 0 and the last is considered bit 7. The IOLineD property specifies which I/O line is used to multiplex the two digits. Multiplexing is a function that allows the two digits to share a single IOGroup. |