Skip to content

Commit

Permalink
Fix Analog.percent_read() and remove extra print statement
Browse files Browse the repository at this point in the history
  • Loading branch information
CleoQc committed May 11, 2017
1 parent db394a4 commit 01a428f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Software/Python/easygopigo.py
Expand Up @@ -232,7 +232,9 @@ def read(self):
return self.value

def percent_read(self):
return self.read * 100 / 1024
value = int(self.read()) * 100 // 1024
# print(value)
return value

def write(self, power):
self.value = power
Expand Down
2 changes: 1 addition & 1 deletion Software/Python/gopigo.py
Expand Up @@ -428,7 +428,7 @@ def corrected_us_dist(pin):
corrected_data = (raw_data + 4.41) / 1.423
else:
corrected_data = raw_data
print(raw_data,corrected_data)
# print(raw_data,corrected_data)
return int(corrected_data)

def read_motor_speed():
Expand Down

0 comments on commit 01a428f

Please sign in to comment.