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()
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