Skip to content

Commit

Permalink
Added missing logic to complete bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryce Bixler committed Aug 19, 2024
1 parent d7c8ec2 commit 113f12b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions socs/agents/hwp_pid/drivers/pid_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,11 @@ def _decode_read(string):
return DecodedResponse(msg_type='error', msg='Unrecognized Read Length')
# Decode target
if read_type == '01':
target = float(int(end_string[4:], 16) / 1000.)
target = float(int(end_string[-5:], 16) / 1000.)
return DecodedResponse(msg_type='read', msg='Setpoint = ' + str(target), measure=target)
# Decode direction
elif read_type == '02':
if int(end_string[4:], 16) / 1000. > 2.5:
if int(end_string[-5:], 16) / 1000. > 2.5:
return DecodedResponse(msg_type='read', msg='Direction = Reverse', measure=1)
else:
return DecodedResponse(msg_type='read', msg='Direction = Forward', measure=0)
Expand Down

0 comments on commit 113f12b

Please sign in to comment.