Make it work not on raspberry pi

This commit is contained in:
Makoto Shimazu
2018-08-04 01:45:16 +09:00
parent 7ab70557a5
commit dcf744ff9e

View File

@@ -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)