mirror of
https://github.com/google/mozc-devices.git
synced 2025-11-09 09:13:27 +03:00
Make it work not on raspberry pi
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
class LEDBase():
|
class LEDBase(object):
|
||||||
def __init__(self, pin):
|
def __init__(self, pin):
|
||||||
self._pin = pin
|
self._pin = pin
|
||||||
def on(self):
|
def on(self):
|
||||||
@@ -25,6 +25,8 @@ class LEDBase():
|
|||||||
pass
|
pass
|
||||||
def blink(self, interval):
|
def blink(self, interval):
|
||||||
pass
|
pass
|
||||||
|
def set_brightness(self, brightness):
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import RPi.GPIO as GPIO
|
import RPi.GPIO as GPIO
|
||||||
@@ -134,6 +136,9 @@ except ImportError as e:
|
|||||||
|
|
||||||
class LED(LEDBase):
|
class LED(LEDBase):
|
||||||
pass
|
pass
|
||||||
|
class SlowLED(LEDBase):
|
||||||
|
def __init__(self, pin, delay_ms):
|
||||||
|
super(SlowLED, self).__init__(pin)
|
||||||
|
|
||||||
LED_BLUE = LED(38)
|
LED_BLUE = LED(38)
|
||||||
LED_RED = LED(40)
|
LED_RED = LED(40)
|
||||||
|
|||||||
Reference in New Issue
Block a user