class TestIR(SyncedSketch):
    def setup(self):
        self.ir = IR(self.tamp, 23)
        self.sum = 0
        self.timer = Timer()
        self.timestep = 0

    def loop(self):
        if (self.timer.millis() > 100):
            self.timer.reset()
            #self.sum += self.ir.read_ir()
            self.timestep += 1
            print self.timestep
            print "raw val:",self.ir.val
            print "distance:",self.ir.read_ir()
Пример #2
0
class TestIR(SyncedSketch):
    def setup(self):
        self.ir = IR(self.tamp, 23)
        self.sum = 0
        self.timer = Timer()
        self.timestep = 0

    def loop(self):
        if (self.timer.millis() > 100):
            self.timer.reset()
            #self.sum += self.ir.read_ir()
            self.timestep += 1
            print self.timestep
            print "raw val:", self.ir.val
            print "distance:", self.ir.read_ir()
 def setup(self):
     self.ir = IR(self.tamp, 23)
     self.sum = 0
     self.timer = Timer()
     self.timestep = 0
Пример #4
0
 def setup(self):
     self.ir = IR(self.tamp, 23)
     self.sum = 0
     self.timer = Timer()
     self.timestep = 0