Changeset - ae2ed47a5321
[Not reviewed]
default
0 1 0
drewp - 22 years ago 2002-07-12 10:59:43

io can now return to being dummy (untested)
io can now return to being dummy (untested)
fixed a wrong method name in SerialPots too
1 file changed with 10 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light8/io.py
Show inline comments
 
@@ -13,6 +13,11 @@ class BaseIO:
 
        # perhaps even loading a module and saving it to a class
 
        # attr so the subclass-specific functions can use it
 
        
 
    def godummy(self):
 
        print "IO: %s is going dummy" % self.__name__
 
        self.dummy=1
 
        # you might override this to close ports, etc
 
        
 
    def isdummy(self):
 
        return self.dummy
 

	
 
@@ -58,7 +63,7 @@ class SerialPots(BaseIO):
 
        self.dummy=1
 
        self.__name__='SerialPots' # i thought this was automatic!
 

	
 
    def startup(self):
 
    def golive(self):
 
        """
 
        ls -l /dev/i2c-0
 
        crw-rw-rw-    1 root     root      89,   0 Jul 11 12:27 /dev/i2c-0
 
@@ -74,6 +79,10 @@ class SerialPots(BaseIO):
 
        ioctl(self.f,I2C_SLAVE,port)
 
        self.dummy=0
 

	
 
    def godummy(self):
 
        BaseIO.godummy(self)
 
        self.f.close()
 

	
 
    def getlevels(self):
 
        if self.dummy:
 
            return (0,0,0,0)
0 comments (0 inline, 0 general)