mirror of
https://github.com/google/mozc-devices.git
synced 2025-11-08 16:53:28 +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
|
||||
# limitations under the License.
|
||||
|
||||
class LEDBase():
|
||||
class LEDBase(object):
|
||||
def __init__(self, pin):
|
||||
self._pin = pin
|
||||
def on(self):
|
||||
@@ -25,6 +25,8 @@ class LEDBase():
|
||||
pass
|
||||
def blink(self, interval):
|
||||
pass
|
||||
def set_brightness(self, brightness):
|
||||
pass
|
||||
|
||||
try:
|
||||
import RPi.GPIO as GPIO
|
||||
@@ -134,6 +136,9 @@ except ImportError as e:
|
||||
|
||||
class LED(LEDBase):
|
||||
pass
|
||||
class SlowLED(LEDBase):
|
||||
def __init__(self, pin, delay_ms):
|
||||
super(SlowLED, self).__init__(pin)
|
||||
|
||||
LED_BLUE = LED(38)
|
||||
LED_RED = LED(40)
|
||||
|
||||
Reference in New Issue
Block a user