git-svn-id: http://moon:8086/svn/projects/HendiControl@380 fda53097-d464-4ada-af97-ba876c37ca34
18 lines
327 B
Python
18 lines
327 B
Python
from atemperatureSensor import ATemperatureSensor
|
|
import math
|
|
|
|
|
|
class TempSensorSim(ATemperatureSensor):
|
|
def name(self):
|
|
return "FakeTemp"
|
|
|
|
def __init__(self):
|
|
self.count = 0
|
|
self.freq = 0.2
|
|
self.log("Created")
|
|
|
|
def temperature(self):
|
|
self.count += 1
|
|
return 22.37 + 0.1*math.sin(2*math.pi*self.count*self.freq)
|
|
|