Skip to content

Commit e1074da

Browse files
committed
doc for on/off and eyes functions
1 parent d62492d commit e1074da

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

buildhat/color.py

+3
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,7 @@ def cb(lst):
201201
return self._old_color
202202

203203
def on(self):
204+
"""
205+
Turns on the sensor and LED
206+
"""
204207
self._write("port {} ; plimit 1 ; set -1\r".format(self.port))

buildhat/devices.py

+6
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,15 @@ def select(self):
129129
self._write("port {} ; select {}\r".format(self.port,idx))
130130

131131
def on(self):
132+
"""
133+
Turns on sensor
134+
"""
132135
self._write("port {} ; plimit 1 ; on\r".format(self.port))
133136

134137
def off(self):
138+
"""
139+
Turns off sensor
140+
"""
135141
self._write("port {} ; off\r".format(self.port))
136142

137143
def deselect(self):

buildhat/distance.py

+5
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ def wait_for_in_range(self, distance):
123123
self._cond_data.wait()
124124

125125
def eyes(self, *args):
126+
"""
127+
Brightness of LEDs on sensor
128+
129+
:param \*args: Four Brightness arguments of 0 to 100
130+
"""
126131
out = [0xc5]
127132
if len(args) != 4:
128133
raise DistanceSensorException("Need 4 brightness args, of 0 to 100")

0 commit comments

Comments
 (0)