blob: 08804faa96caf379e1e8fd479abc2d3d6f539a03 (
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 = 4
data_pin = 3
e = Encoder(clk_pin, cs_pin, data_pin)
e.setZero()
while(1):
print(e.readPosition('Degrees'))
time.sleep(0.001)
|