You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-12Lines changed: 25 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,22 @@ void setup() {
102
102
If you wish to use more than 8 digits, increase MAXNUMDIGITS in SevSeg.h.
103
103
104
104
105
+
### Refreshing the display
106
+
107
+
```c++
108
+
sevseg.refreshDisplay();
109
+
```
110
+
111
+
Your program must run the refreshDisplay() function repeatedly to display the number.
112
+
**Warning: Any calls to delay() will interfere with the display.**
113
+
Any delays introduced by other functions will produce undesirable effects on the display. If you need help getting away from delay() statements, I recommend the simple [Blink Without Delay][9] arduino example sketch.
114
+
115
+
To blank the display, call:
116
+
117
+
```c++
118
+
sevseg.blank();
119
+
```
120
+
105
121
### Setting a number
106
122
#### Integer
107
123
```c++
@@ -127,23 +143,19 @@ Note that:
127
143
sevseg.setChars("abcd");
128
144
```
129
145
130
-
Character arrays can be displayed - as accurately as possible on a seven segment display. See SevSeg.cpp digitCodeMap[] to notes on each character. Only alphanumeric characters, plus ' ', '-' and '.' are supported. The character array should be NULL terminated.
131
-
132
-
133
-
### Refreshing the display
146
+
Character arrays can be displayed - as accurately as possible on a seven segment display. See SevSeg.cpp digitCodeMap[] to notes on each character. Only alphanumeric characters, plus ' ', '-', '_', and '.' are supported. The character array should be NULL terminated.
134
147
148
+
### Custom display setting
135
149
```c++
136
-
sevseg.refreshDisplay();
150
+
// Set the segments for every digit on the display
151
+
uint8_t segs[4] = {0, 0x5B, 0x6D, 0x63};
152
+
sevseg.setSegments(segs);
137
153
```
138
-
139
-
Your program must run the refreshDisplay() function repeatedly to display the number. Note that any delays introduced by other functions will produce undesirable effects on the display.
140
-
141
-
To blank the display, call:
142
-
143
154
```c++
144
-
sevseg.blank();
155
+
// Set the segments for a single digit. Set digit 3 to 0x63.
156
+
sevseg.setSegmentsDigit(3, 0x63);
145
157
```
146
-
158
+
You can manipulate individual segments if needed. Each byte represents the display of a single digit, with each bit representing a single segment. The bits represent segments in the order .GFEDCBA. See SevSeg.cpp for more examples of these 'digitCodes'.
0 commit comments