Skip to content

Commit 704ed8c

Browse files
committed
going for v0.2.1
1 parent 1cb4da9 commit 704ed8c

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DumbDisplay MicroPython Library #
1+
# DumbDisplay MicroPython Library (v0.2.1) #
22

33
DumbDisplay MicroPython Library is a port of the Arduino DumbDisplay Library (https://github.com/trevorwslee/Arduino-DumbDisplay)
44
for the DumbDisplay Android app -- https://play.google.com/store/apps/details?id=nobody.trevorlee.dumbdisplay
@@ -7,7 +7,7 @@ For a video introduction, please watch the YouTube video: Introducing DumbDispla
77

88
Although the porting is not complete, nevertheless, a large portion of DumbDisplay functionalities have been ported. Hopefully, this should already be helpful for friends that develop programs for micro-controller boards in Micro-Python.
99

10-
Note that even though it is targeted for MicroPython, it is still usable with regular Python 3, like in Raspberry Pi environment,
10+
Note that even it is targeted for MicroPython, it is still usable with regular Python 3, like in Raspberry Pi environment,
1111
or even with desktop / laptop.
1212

1313

@@ -120,3 +120,13 @@ Notes:
120120
121121
## Enjoy! May God bless you! Peace be with you! Jesus loves you! ##
122122
123+
124+
125+
# Change History
126+
127+
128+
v0.2.1
129+
- add plotter layer
130+
- bug fixes
131+
132+

dumbdisplay/_ddlayer_plotter.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from ._ddlayer import DDLayer
2+
from ._ddlayer import _DD_BOOL_ARG
3+
from ._ddlayer import _DD_COLOR_ARG
4+
5+
class DDLayerPlotter(DDLayer):
6+
'''Plotter'''
7+
def __init__(self, dd, width, height, pixels_per_second = 10):
8+
'''
9+
:param dd: DumbDisplay object
10+
:param width: width
11+
:param height: height
12+
:param pixels_per_second: # pixel to scroll per second
13+
'''
14+
layer_id = dd._createLayer(str("plotterview"), str(width), str(height), str(pixels_per_second))
15+
super().__init__(dd, layer_id)
16+
def label(self, **key_label_pairs):
17+
'''set labels of keys; if key has no label, the key will be the label'''
18+
for (key, lab) in key_label_pairs.items():
19+
self.dd._sendCommand(self.layer_id, "label", key, str(lab))
20+
def set(self, **key_value_pairs):
21+
'''set values with multiple key value pairs; value should be numeric'''
22+
params = []
23+
for (k, v) in key_value_pairs.items():
24+
params.append(k)
25+
params.append(str(v))
26+
self.dd._sendCommand(self.layer_id, "", *params)

dumbdisplay/layer_plotter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from ._ddlayer_plotter import DDLayerPlotter as LayerPlotter
2+

dumbdisplay/layers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
from ._ddlayer_lcd import DDLayerLcd as LayerLcd
33
from ._ddlayer_graphical import DDLayerGraphical as LayerGraphical
44
from ._ddlayer_7segrow import DDLayer7SegmentRow as Layer7SegmentRow
5+
from ._ddlayer_plotter import DDLayerPlotter as LayerPlotter

0 commit comments

Comments
 (0)