aboutsummaryrefslogtreecommitdiffstats
path: root/System_Python/encoder.py
diff options
context:
space:
mode:
authordamic014 <damic014@umn.edu>2019-10-13 22:14:47 -0500
committerdamic014 <damic014@umn.edu>2019-10-13 22:14:47 -0500
commit9c54528920a03fe046c50bc582067d8f2514d1c8 (patch)
tree001e66d5200982387158b3bda93b27d53b2743cb /System_Python/encoder.py
parentEncoder class (diff)
downloadee4511w-9c54528920a03fe046c50bc582067d8f2514d1c8.tar
ee4511w-9c54528920a03fe046c50bc582067d8f2514d1c8.tar.gz
ee4511w-9c54528920a03fe046c50bc582067d8f2514d1c8.tar.bz2
ee4511w-9c54528920a03fe046c50bc582067d8f2514d1c8.tar.lz
ee4511w-9c54528920a03fe046c50bc582067d8f2514d1c8.tar.xz
ee4511w-9c54528920a03fe046c50bc582067d8f2514d1c8.tar.zst
ee4511w-9c54528920a03fe046c50bc582067d8f2514d1c8.zip
Add System library and system test file. Still need to finalize some implementation details (linear encoder, motor orientation, etc.). Need to compile and test on RPi still.
Convert naming in other libraries to follow Python naming scheme.
Diffstat (limited to 'System_Python/encoder.py')
-rw-r--r--System_Python/encoder.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/System_Python/encoder.py b/System_Python/encoder.py
index b70fac6..4069a86 100644
--- a/System_Python/encoder.py
+++ b/System_Python/encoder.py
@@ -30,14 +30,14 @@ class Encoder:
print("ERROR. Unable to setup the configuration required")
# Wait some time to before reading
time.sleep(0.5)
- def setZero(self):
+ def set_zero(self):
# Take current position as zero
- self.offset=self.readPosition('Raw')
+ self.offset=self.read_position('Raw')
def clockup(self):
GPIO.output(self.clk_pin,1)
def clockdown(self):
GPIO.output(self.clk_pin,0)
- def readPosition(self, format):
+ def read_position(self, format):
# Most of this is based of timing diagram of encoder
# Pull CS low to start reading
GPIO.output(self.cs_pin,0)