|
| 1 | +# EV3D4 |
| 2 | +EV3D4 is designed to look like R2-D2 from Star Wars. There are two options for |
| 3 | +controlling EV3D4. The first is to use the IR remote to send commands to the IR |
| 4 | +sensor, run EV3D4RemoteControl to use this method. The second means of |
| 5 | +controlling EV3D4 is via a web browser, run EV3D4WebControl to use this method. |
| 6 | + |
| 7 | +**Building instructions**: https://www.lego.com/en-us/mindstorms/build-a-robot/ev3d4 |
| 8 | + |
| 9 | +### EV3D4RemoteControl |
| 10 | +If you are using EV3D4RemoteControl the only other file you need from |
| 11 | +`demo/EV3D4/` is EV3D4.py. The other files are only needed by EV3D4WebControl. |
| 12 | + |
| 13 | +EV3D4RemoteControl creates a child class of ev3dev/helper.py's |
| 14 | +RemoteControlledTank. |
| 15 | + |
| 16 | + |
| 17 | +### EV3D4WebControl |
| 18 | +EV3D4WebControl creates a child class of ev3dev/helper.py's WebControlledTank. |
| 19 | +The WebControlledTank class runs a web server that serves the web pages, |
| 20 | +images, etc but it also services the AJAX calls made via the client. The user |
| 21 | +loads the initial web page at which point they choose the "Desktop interface" |
| 22 | +or the "Mobile Interface". |
| 23 | + |
| 24 | +Desktop Interface - The user is presented with four arrows for moving forwards, |
| 25 | +backwards, spinning clockwise or spinning counter-clockwise. Two additional |
| 26 | +buttons are provided for controlling the medium motor. There are two sliders, |
| 27 | +one to control the speed of the tank and the other to control the speed of the |
| 28 | +medium motor. |
| 29 | + |
| 30 | +Mobile Interface - The user is presented with a virtual joystick that is used |
| 31 | +to control the movements of the robot. Slide your thumb forward and the robot |
| 32 | +moves forward, slide it to the right and the robot spins clockwise, etc. The |
| 33 | +further you move the joystick towards the edge of the circle the faster the |
| 34 | +robot moves. Buttons and a speed slider for the medium motor are also provided. |
| 35 | + |
| 36 | +Both interfaces have touch support so you can use either Desktop or Mobile from |
| 37 | +your smartphone. When the user clicks/touches a button some jQuery code will |
| 38 | +fire off an AJAX call to let the EV3D4 web server know what the user clicked or |
| 39 | +where the joystick is if using the Mobile Interface. The web server in |
| 40 | +WebControlledTank services this AJAX call and adjust motor speed/power |
| 41 | +accordingly. |
| 42 | + |
| 43 | +You can see a demo of the web interface below. Note that the demo is on a |
| 44 | +simple Tank robot, not EV3D4, but that doesn't really matter as EV3D4 is also |
| 45 | +just a Tank robot. |
| 46 | + |
| 47 | +**Demo Video**: https://www.youtube.com/watch?v=x5VauXr7W4A |
0 commit comments