Skip to content

Commit

Permalink
Add examples folder
Browse files Browse the repository at this point in the history
  • Loading branch information
UmSenhorQualquer committed Feb 21, 2018
1 parent 6933720 commit cc77796
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/retrieve-data-from-sdcard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from pybpod_rotaryencoder_module.module_api import RotaryEncoderModule

m = RotaryEncoderModule('/dev/ttyACM1')

m.enable_stream()

#print the first 100 outputs
count = 0
while count<100:
data = m.read_stream()
if len(data)==0:
continue
else:
count += 1
print(data)

m.disable_stream()

print('set', m.set_position(179))
m.set_zero_position()

m.enable_thresholds([True, False, True, True, False, False, True, True])
print(m.current_position())

m.close()

0 comments on commit cc77796

Please sign in to comment.