We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9871ba8 commit a15257cCopy full SHA for a15257c
examples/synthwaveform_oscilloscope.py
@@ -75,8 +75,8 @@ def update():
75
# Draw waveform on screen
76
display.fill(0)
77
for i in range(data.size):
78
- y1 = int((HEIGHT - data[i] * HEIGHT) / 2)
79
- y2 = int((HEIGHT - data[(i + 1) % WIDTH] * HEIGHT) / 2)
+ y1 = min(int((HEIGHT - data[i] * HEIGHT) / 2), HEIGHT - 1)
+ y2 = min(int((HEIGHT - data[(i + 1) % WIDTH] * HEIGHT) / 2), HEIGHT - 1)
80
if y1 == y2:
81
display.pixel(i, y1, 1)
82
else:
0 commit comments