Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions main_iseries_temp_controller_rev1.0.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
start_pin = Pin('Y3', Pin.IN, Pin.PULL_UP) # PB8 monitors start button push event.
stop_pin = Pin('X2', Pin.IN, Pin.PULL_UP) # PA1 monitors stop button push event.
led_pin = Pin('X5', Pin.OUT_PP) # PA4 drives LED indicator.
led_pin.low()
led_pin.low()
uart = UART(2, 9600) # UART2 communcates to CSi8.
uart.init(9600, bits=7, parity=1, stop=1)
uart.init(9600, bits=7, parity=1, stop=1)
Comment on lines -9 to +11
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 9-27 refactored with the following changes:

start_pressed = 0
# stop_pressed = 0
t1_set = 200
Expand All @@ -23,8 +23,8 @@
cmd_dis_standby = '*E03'# Disable standby
start_value = 0
stop_value = 0
print("stop_pin.value="+str(stop_pin.value()))
print("start_pin.value="+str(start_pin.value()))
print(f"stop_pin.value={str(stop_pin.value())}")
print(f"start_pin.value={str(start_pin.value())}")

def start_callback(line):

Expand Down Expand Up @@ -57,9 +57,9 @@ def stop_callback(line):

stop_int = pyb.ExtInt(stop_pin, pyb.ExtInt.IRQ_FALLING, pyb.Pin.PULL_UP, stop_callback)

while (1):
while 1:
#global pyb
print("one loop passed-----"+str(start_pressed))
print(f"one loop passed-----{str(start_pressed)}")
Comment on lines -60 to +62
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 60-62 refactored with the following changes:

sleep(1)
if start_pressed == 1:
uart.write(cmd_dis_standby+'\r') # Disable standby from last heating cycle
Expand Down