README.md 1.3 KB
Newer Older
Cédric Bonhomme's avatar
Cédric Bonhomme committed
1 2 3 4 5 6 7 8 9 10
EV3WebController
================

# Presentation

This application based on the [Flask](http://flask.pocoo.org/)
microframework provides an interface in order to control the EV3 robot.

Tested with Python 3.4 and Python 2.7.

11
# How to use the interface
Cédric Bonhomme's avatar
Cédric Bonhomme committed
12

13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
## Move the robot

    $ GET http://192.168.1.10:5000/move/<direction>/<speed=60>

The value of *speed* is optional. Default is 60.

Acceptable values for *direction*:

* forward;
* backward;
* left;
* right;
* stop.

### Examples

    $ GET http://username:password@192.168.1.10:5000/move/forward/50
    {"message": "OK", "direction": "forward", "action": "move"}

In this case the HTTP status code returned is 200.

    $ GET http://127.0.0.1:5000/move/nowhere
    {"message": "Unknown direction", "direction": "nowhere", "action": "move"}

In this case the HTTP status code returned is 400.


## Retrieve values from sensors

    $ GET http://192.168.1.10:5000/sensor/<sensor_name>

Acceptable values for *sensor_name*:

* button;
* ir_sensor.


### Examples

    $ GET http://username:password@192.168.1.10:5000/sensor/ir_sensor
    {"distance": 12}


# License

cve-search is free software released under the "Modified BSD license"

60
Copyright (c) 2014-2015 Cédric Bonhomme - https://www.cedricbonhomme.org
Cédric Bonhomme's avatar
Cédric Bonhomme committed
61 62 63

# Contact

64
[Cédric Bonhomme](https://www.cedricbonhomme.org).