Skip to content

Commit

Permalink
Remove float value condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuang94 committed Dec 20, 2023
1 parent 725db7c commit 289ac2d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pyB12MPS/mps.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,10 +965,7 @@ def writeeeprom(self, address, data_type, data):
self.send_command("write %i %s %i" % (address, data_type, data), recv=True)

elif data_type in ["float"]:
data = int(
np.float32(data).view(np.uint32)
) # convert to 4 bytes then to uint32_t to store data in EEPROM
self.send_command("write %i 'uint32_t' %i" % (address, data), recv=True)
self.send_command("write %i float %f" % (address, data), recv=True)

else:
raise ValueError("Input argument is invalid.")
Expand Down

0 comments on commit 289ac2d

Please sign in to comment.