Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I45 #57

Merged
merged 8 commits into from
Feb 1, 2019
Merged

I45 #57

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add detectLine
  • Loading branch information
APRader committed Feb 1, 2019
commit e969ac5e107c3018e99feb30386cbf5a02906268
20 changes: 20 additions & 0 deletions ev3/detectLine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /usr/bin/env python3
import ev3dev.ev3 as ev3

class detectLine:
# Constructor
def __init__(self):
self.btn = ev3.Button()
self.shut_down = False

def run(self):
cs = ev3.ColorSensor()
assert cs.connected

cs.mode = 'COL-REFLECT' # measure light intensity

# motors
flm = ev3.LargeMotor('outA') # forward-left motor
frm = ev3.LargeMotor('outB') # forward-right motor
sm = ev3.LargeMotor('outC') # sidemotor
sm.run_timed(speed_sp=300, time_sp=1000)