comparison light8/io.py @ 89:0459cecf8145

added missing imports and constants to SerialPots
author drewp
date Sat, 13 Jul 2002 02:28:45 +0000
parents ae2ed47a5321
children
comparison
equal deleted inserted replaced
88:238fbd5266ea 89:0459cecf8145
1
1 2
2 class BaseIO: 3 class BaseIO:
3 def __init__(self): 4 def __init__(self):
4 self.dummy=1 5 self.dummy=1
5 self.__name__ = 'BaseIO' 6 self.__name__ = 'BaseIO'
74 self.f = open("/dev/i2c-0","rw") 75 self.f = open("/dev/i2c-0","rw")
75 76
76 # this is for a chip with A0,A1,A2 lines all low: 77 # this is for a chip with A0,A1,A2 lines all low:
77 port = 72 78 port = 72
78 79
80 from fcntl import *
81
82 I2C_SLAVE = 0x0703 #/* Change slave address */
79 ioctl(self.f,I2C_SLAVE,port) 83 ioctl(self.f,I2C_SLAVE,port)
80 self.dummy=0 84 self.dummy=0
81 85
82 def godummy(self): 86 def godummy(self):
83 BaseIO.godummy(self) 87 BaseIO.godummy(self)