Added movements.py to factorize the different kind of movements.

parent 36af0087
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# ***** BEGIN LICENSE BLOCK *****
# This file is part of EV3WebController.
# Copyright (c) 2014-2015 Cédric Bonhomme.
# All rights reserved.
#
#
#
# ***** END LICENSE BLOCK *****
__author__ = "Cedric Bonhomme"
__version__ = "$Revision: 0.1 $"
__date__ = "$Date: 2015/11/05$"
__revision__ = "$Date: 2015/11/05 $"
__copyright__ = "Copyright (c) 2014-2015 Cédric Bonhomme"
__license__ = ""
from ev3.ev3dev import Motor
def run_position_limited(motorA, motorB, position):
"""
Run for a limitied position.
"""
motorA.position = 0
motorA.run_position_limited(position_sp=position, speed_sp=800,
stop_mode=Motor.STOP_MODE.BRAKE, ramp_up_sp=1000,
ramp_down_sp=1000)
motorB.position = 0
motorB.run_position_limited(position_sp=position, speed_sp=800,
stop_mode=Motor.STOP_MODE.BRAKE, ramp_up_sp=1000,
amp_down_sp=1000)
......@@ -14,7 +14,7 @@ __author__ = "Cedric Bonhomme"
__version__ = "$Revision: 0.4 $"
__date__ = "$Date: 2014/12/15$"
__revision__ = "$Date: 2015/11/04 $"
__copyright__ = "Copyright (c) 2014-2015 Cédric BOnhomme"
__copyright__ = "Copyright (c) 2014-2015 Cédric Bonhomme"
__license__ = ""
from flask import render_template, current_app, request, session, \
......@@ -27,6 +27,7 @@ from ev3.ev3dev import Motor
import conf
from web.decorators import to_response
from web import app
from web.lib import movements
from web import right_wheel, left_wheel, button, ir_sensor, color_sensor
login_manager = LoginManager(app)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment