16 lines
604 B
Plaintext

import Text.Read
import Data.Maybe
import TemperatureData
import HumidityData
import BatteryData
d1 $ s "bd"
-- Yes, i know this is not optimal...
getFloat x = maybe 0.0 id (readMaybe x :: Maybe Float)
-- Do something audible with the temperature data for the first time ever
d1 $ fast 10 $ n (fromList (map (\x -> fromInteger (round ((getFloat x)*10))) (map (\x -> snd x) (take 100 temperaturedata)))) # s "jvbass" # room 0.5 # delay 0.7
d2 $ fast 10 $ n (fromList (map (\x -> fromInteger (round ((getFloat x)*5))) (map (\x -> snd x) (take 100 humiditydata)))) # s "arpy" # room 0.5 # delay 0.7