added noise
git-svn-id: http://moon:8086/svn/projects/HendiControl@198 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
from atemperatureSensor import ATemperatureSensor
|
||||
import math
|
||||
|
||||
|
||||
class TempSensorSim(ATemperatureSensor):
|
||||
def __init__(self, name):
|
||||
super(TempSensorSim, self).__init__(name)
|
||||
self.count = 0
|
||||
self.freq = 0.2
|
||||
|
||||
def temperature(self):
|
||||
return 22.37
|
||||
self.count += 1
|
||||
return 22.37 + 0.1*math.sin(2*math.pi*self.count*self.freq)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user