diff --git a/hydrobot_sensor_sim.py b/hydrobot_sensor_sim.py deleted file mode 100644 --- a/hydrobot_sensor_sim.py +++ /dev/null @@ -1,31 +0,0 @@ -import time -import random -from canard import can, bus -from canard.hw import socketcan -from canard.file import jsondb - -parser = jsondb.JsonDbParser() -b = parser.parse('hydrobot_can.json') - -dev = socketcan.SocketCanDev("can1") -dev.start() - -temp = 65.5 -humid = 0.90 -press = 100 - -while True: - - temp = max(0x00, min(0xFF, random.randint(-1, 1)/2 + temp)) - humid = max(0x00, min(0xFF, random.randint(-1, 1)/100 + humid)) - press = max(0x00, min(0xFF, random.randint(-1, 1) + press)) - - print(b.AirTemp.Temperature.value) - - b.AirTemp.Temperature.value = temp - b.AirTemp.Humidity.value = humid - b.AirTemp.Pressure.value = press - - dev.send(b.AirTemp.encode()) - - time.sleep(1)