From 7b840945be9f36eae9bed678b57f7018651fa11c Mon Sep 17 00:00:00 2001 From: Snorre Selmer Date: Sun, 29 Aug 2021 14:08:52 +0200 Subject: [PATCH] Added scripts written before I moved to GitHub --- automatic_canister_filler.ic10 | 4 ++ heating_cooling.ic10 | 73 ++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 automatic_canister_filler.ic10 create mode 100644 heating_cooling.ic10 diff --git a/automatic_canister_filler.ic10 b/automatic_canister_filler.ic10 new file mode 100644 index 0000000..c0c3ce9 --- /dev/null +++ b/automatic_canister_filler.ic10 @@ -0,0 +1,4 @@ +# check canister type in tank storage +# set target pressure accordingly +# run volume pump until target pressure in canister is reached +# stop volume pump \ No newline at end of file diff --git a/heating_cooling.ic10 b/heating_cooling.ic10 new file mode 100644 index 0000000..cb07a98 --- /dev/null +++ b/heating_cooling.ic10 @@ -0,0 +1,73 @@ +alias gas_sensor d0 +alias thermostat d1 # Logic Switch, variant +alias temp_variance d2 # Logic Memory +alias curr_temp r0 +alias target_temp r1 +alias variance r2 +alias min_temp r3 +alias max_temp r4 +alias cooling_active r5 +alias heating_active r6 + +define wall_heaters 24258244 # Wall Heaters +define wall_coolers -739292323 # Wall Coolers (Gas) +define liquid_wall_coolers -1369060582 # Wall Coolers (Liquid) +define temp_convert 273 + +start: +# establish min- and max-temps to registry +l variance temp_variance Setting +l min_temp thermostat Setting +sub min_temp min_temp variance +l max_temp thermostat Setting +add max_temp max_temp variance + +# initiate target temperature +l target_temp thermostat Setting + +# read ambient temp from sensor and convert to C +l curr_temp gas_sensor Temperature +sub curr_temp curr_temp temp_convert + +# compare current temp to max/min temp and +# initiate cooling or heating if needed +bgt curr_temp max_temp cooling +blt curr_temp min_temp heating + +yield + +# Go to start again +j start + +cooling: +# read ambient temp from sensor and convert to C +l curr_temp gas_sensor Temperature +sub curr_temp curr_temp temp_convert +sgt cooling_active curr_temp target_temp + +# send state to coolers +sb wall_coolers On cooling_active +sb liquid_wall_coolers On cooling_active +yield + +# if curr_temp is lower than target, keep cooling +bgt curr_temp target_temp cooling + +# ...if not, go to start again +j start + +heating: +# read ambient temp from sensor and convert to C +l curr_temp gas_sensor Temperature +sub curr_temp curr_temp temp_convert +slt heating_active curr_temp target_temp + +# send state to heaters +sb wall_heaters On heating_active +yield + +# if curr_temp is lower than target, keep heating +blt curr_temp target_temp heating + +# ...if not, go to start again +j start \ No newline at end of file