Skip to content

Commit

Permalink
Changed read function to return float of value
Browse files Browse the repository at this point in the history
Fixes #32

Co-Authored-By: scavenrage <[email protected]>
  • Loading branch information
bverc and scavenrage committed Apr 9, 2024
1 parent 4f76500 commit ca23722
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adc/ser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ADC module for Serial based devices, such as an Arduino
Authors: R41zan, bverc
Authors: R41zan, scavenrage, bverc
Requires python module pySerial
install: python3 -m pip install pyserial
Expand All @@ -28,4 +28,4 @@ def read(channel): # pylint: disable=unused-argument
"""Read from ADC and return voltage."""
ser.reset_input_buffer() # Clear input buffer
value_v = ser.readline().decode('utf-8').rstrip()
return value_v
return float(value_v)

0 comments on commit ca23722

Please sign in to comment.