aboutsummaryrefslogtreecommitdiffstats
path: root/System/test_Encoder.py
diff options
context:
space:
mode:
Diffstat (limited to 'System/test_Encoder.py')
-rw-r--r--System/test_Encoder.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/System/test_Encoder.py b/System/test_Encoder.py
new file mode 100644
index 0000000..9a2119a
--- /dev/null
+++ b/System/test_Encoder.py
@@ -0,0 +1,14 @@
+from encoder import Encoder
+import time
+
+# Decide which pins to hook up to on the Pi before running
+clk_pin = 2
+cs_pin = 14
+data_pin = 3
+
+e = Encoder(clk_pin, cs_pin, data_pin)
+e.set_zero()
+
+while(1):
+ print(e.read_position('Degrees'))
+ time.sleep(0.001) \ No newline at end of file