corrected a brief brainfart
This commit is contained in:
parent
ad49956139
commit
e083828dfa
|
@ -17,14 +17,15 @@ class uPyConfig:
|
||||||
|
|
||||||
class _owc:
|
class _owc:
|
||||||
from onewire import OneWire
|
from onewire import OneWire
|
||||||
|
from machine import Pin
|
||||||
def __init__(self, pin):
|
def __init__(self, pin):
|
||||||
if pin.__class__ != self.Pin: pin=self.Pin(pin)
|
if pin.__class__ != self.Pin: pin=self.Pin(pin)
|
||||||
self.bus = self.OneWire(pin)
|
self.bus = self.OneWire(pin)
|
||||||
|
|
||||||
class _i2c:
|
class _i2c:
|
||||||
from machine import I2C
|
from machine import I2C, Pin
|
||||||
def load_handle(self):
|
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 = self.I2C(scl=self.scl, sda=self.sda)
|
||||||
self.bus.init(scl=self.scl, sda=self.sda)
|
self.bus.init(scl=self.scl, sda=self.sda)
|
||||||
|
|
||||||
|
@ -36,6 +37,7 @@ class uPyConfig:
|
||||||
self.load_handle()
|
self.load_handle()
|
||||||
|
|
||||||
class _oled:
|
class _oled:
|
||||||
|
from machine import Pin
|
||||||
addr = 0x0
|
addr = 0x0
|
||||||
rst = 0
|
rst = 0
|
||||||
rst_hold = False
|
rst_hold = False
|
||||||
|
|
Loading…
Reference in New Issue