corrected a brief brainfart

This commit is contained in:
Matthew Connelly 2018-06-11 15:23:48 +01:00
parent ad49956139
commit e083828dfa
1 changed files with 4 additions and 2 deletions

View File

@ -17,14 +17,15 @@ class uPyConfig:
class _owc:
from onewire import OneWire
from machine import Pin
def __init__(self, pin):
if pin.__class__ != self.Pin: pin=self.Pin(pin)
self.bus = self.OneWire(pin)
class _i2c:
from machine import I2C
from machine import I2C, Pin
def load_handle(self):
if self.bus.__class__ == self.I2C: return
if hasattr(self, 'bus'): return
self.bus = self.I2C(scl=self.scl, sda=self.sda)
self.bus.init(scl=self.scl, sda=self.sda)
@ -36,6 +37,7 @@ class uPyConfig:
self.load_handle()
class _oled:
from machine import Pin
addr = 0x0
rst = 0
rst_hold = False