diff --git a/BreakfastSerial/BreakfastSerial.py b/BreakfastSerial/BreakfastSerial.py index 3df9566..68ad201 100644 --- a/BreakfastSerial/BreakfastSerial.py +++ b/BreakfastSerial/BreakfastSerial.py @@ -35,6 +35,12 @@ def __init__(self, *args, **kwargs): newargs = (find_arduino(),) super(Arduino, self).__init__(*newargs) + # Get protocol version + self.sp.write(chr(0xF9)) + self.pass_time(1) + while self.bytes_available(): + self.iterate() + if not self.get_firmata_version(): raise FirmataNotOnBoardException diff --git a/BreakfastSerial/components.py b/BreakfastSerial/components.py index c528fda..f1777ff 100644 --- a/BreakfastSerial/components.py +++ b/BreakfastSerial/components.py @@ -75,6 +75,7 @@ def __init__(self, board, pin): super(Led, self).__init__(board, pin) self._isOn = False self._interval = None + self._pin.mode = pyfirmata.OUTPUT def on(self): self._pin.write(1)