This commit is contained in:
21
script/test/TestStrip.py
Normal file
21
script/test/TestStrip.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import random
|
||||
|
||||
####################################################################################################
|
||||
# Simulated Devices
|
||||
####################################################################################################
|
||||
|
||||
class AnalogInput(ReadonlyRegisterBase):
|
||||
def doRead(self):
|
||||
time.sleep(0.001)
|
||||
self.val = to_array(self.calc(), 'd')
|
||||
return self.val
|
||||
|
||||
class Random(AnalogInput):
|
||||
def calc(self):
|
||||
return random.random()
|
||||
|
||||
|
||||
for i in range(20):
|
||||
r=Random("r"+str(i))
|
||||
add_device(r, True)
|
||||
r.polling=5
|
||||
Reference in New Issue
Block a user