Skip to content

Commit f135597

Browse files
authored
Merge pull request RaspberryPiFoundation#39 from RaspberryPiFoundation/fix-pos
get abs pos, from correct index
2 parents ca2ea4a + 459ec0d commit f135597

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

buildhat/motors.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ def get_position(self):
9292
return self._motor.get()[2]
9393

9494
def get_aposition(self):
95-
return self._motor.get()[3]
95+
"""Gets absolute position of motor
96+
97+
:return: Absolute position of motor
98+
:rtype: int
99+
"""
100+
return self._motor.get()[1]
96101

97102
def get_speed(self):
98103
"""Gets speed of motor

0 commit comments

Comments
 (0)