doc: initial content for hubs

This is cherry-picking from 86e9b0b0fc15b019406bee43718fbdf3416dcf0d
This commit is contained in:
Laurens Valk
2019-04-20 11:51:03 +02:00
parent 3bf2704466
commit 3ffa8a4526
4 changed files with 13 additions and 23 deletions
-20
View File
@@ -257,10 +257,6 @@ class Motor():
class Display():
"""Show images or text on a display."""
def __init__(self, device_type):
"""Device-specific display initialization."""
pass
def clear(self):
"""Clear everything on the display."""
pass
@@ -317,10 +313,6 @@ class Display():
class Speaker():
"""Play beeps and sound files using a speaker."""
def __init__(self, device_type):
"""Device specific speaker initialization."""
pass
def beep(self, frequency=500, duration=100, volume=30):
"""Play a beep/tone.
@@ -375,23 +367,11 @@ class Speaker():
class Battery():
"""Get the status of a battery."""
def __init__(self, device_type):
"""Battery-specific initialization."""
pass
def voltage(self):
"""Get the voltage of the battery.
Returns:
:ref:`voltage`: Battery voltage.
Examples::
# Play a warning sound when the battery voltage
# is below 7 Volt (7000 mV = 7V)
if brick.battery.voltage() < 7000:
brick.sound.beep()
"""
pass
+3 -3
View File
@@ -48,6 +48,6 @@ def light(color):
pass
sound = Speaker('EV3')
display = Display('EV3')
battery = Battery('EV3')
sound = Speaker()
display = Display()
battery = Battery()
+5
View File
@@ -0,0 +1,5 @@
"""LEGO® Power Functions 2.0 Hub 4."""
from _common import Battery
battery = Battery()
+5
View File
@@ -0,0 +1,5 @@
"""LEGO® Power Functions 2.0 Move Hub."""
from _common import Battery
battery = Battery()