proc luxòmetre
esbt
(escriu luxòmetre.llegit
"d [lux])
espera 50
fi
proc crepuscular
desactiva.sortida "b 1
llum_off
fi
proc llum_off
desactiva.sortida "b 1
luxòmetre
si luxòmetre.llegit
"d <50 [llum_on acaba]
llum_off
fi
proc llum_on
activa.sortida "b 1
luxòmetre
si luxòmetre.llegit
"d >50 [llum_off acaba]
llum_on
fi
proc termòmetre
esbt
(escriu termòmetre.llegit
"c [ºC])
espera 50
fi
proc calefacció
desactiva.sortida "b 2
calefacció_off
fi
proc calefacció_off
desactiva.sortida "b 2
termòmetre
si termòmetre.llegit
"c <18 [calefacció_on acaba]
calefacció_off
fi
proc calefacció_on
activa.sortida "b 2
termòmetre
si termòmetre.llegit
"c >20 [calefacció_off acaba]
calefacció_on
fi
proc aire_condicionat
desactiva.sortida "b 3
aire_condicionat_off
fi
proc aire_condicionat_off
desactiva.sortida "b 3
termòmetre
si termòmetre.llegit
"c >25 [aire_condicionat_on acaba
aire_condicionat_off
fi
proc aire_condicionat_on
activa.sortida "b 3
termòmetre
si termòmetre.llegit
"c <23 [aire_condicionat_off acaba]
aire_condicionat_on
fi
proc higròmetre
esbt
(escriu higròmetre.llegit
"g [%])
espera 50
fi
proc humitat
desactiva.sortida "b 4
humitat_off
fi
proc humitat_off
desactiva.sortida "b 4
higròmetre
si higròmetre.llegit
"g >60 [humitat_on acaba]
humitat_off
fi
proc humitat_on
activa.sortida "b 4
higròmetre
si higròmetre.llegit
"g <50 [humitat_off acaba]
humitat_on
fi
proc sauna
envia.byte "b 0
si veres.totes termòmetre.llegit
"c > 40 higròmetre.llegit "g > 80 [activa.sortida "b 5]
fi
proc sonòmetre
esbt
(escriu sonòmetre.llegit
"h [dB])
espera 50
fi
proc gos
envia.byte "b 0
desactiva.sortida "b 6
gos_off
fi
proc gos_off
desactiva.sortida "b 6
sonòmetre
si sonòmetre.llegit
"h >80 [gos_on acaba]
gos_off
fi
proc gos_on
activa.sortida "b 6
sonòmetre
si sonòmetre.llegit
"h <80 [gos_off acaba]
gos_on
fi