aboutsummaryrefslogtreecommitdiffstats
path: root/System/test_Encoder.py
blob: 9a2119a18be042d2d344e82d11ea7695b0027d86 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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)