Skip to content

Commit

Permalink
fixing soyosource data frame
Browse files Browse the repository at this point in the history
There was an error in an old fix, that solved wrong values in small demands < 20 W. But introduced errors around 250 / 500 W.
This one is tested with 3 different hardware versions and no anomaly was found anymore.
  • Loading branch information
E-t0m committed Sep 10, 2023
1 parent 4b0e9af commit 8d31cba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zeroinput.py
Expand Up @@ -65,7 +65,9 @@ def set_soyo_demand(ser,power): # create the packet for soyosource gti
pu = power >> 8
pl = power & 0xFF
cs = 264 - pu - pl
if cs >= 256: cs = 8
if cs > 255:
if power > 250: cs -= 256
else: cs -= 255

ser.write( bytearray([0x24,0x56,0x00,0x21,pu,pl,0x80,cs]) )
ser.flush()
Expand Down

0 comments on commit 8d31cba

Please sign in to comment.