~~NOTOC~~ ====== Robotik mit EV3 ====== ===== Installation MicroPython auf EV3 ==== * [[ofi:vscode-ev3|Native Python auf EV3 mit VSCode]] * [[https://antonsmindstorms.com/2019/06/15/how-to-run-python-on-an-ev3-brick/| Install, First Steps]] * Connection by WLAN: * Start the EV3. * Using the EV3 keyboard, choose "Wireless and Networks" and confirm. * Choose WIFI * Start Scan (and wait until network "tech-lab" is found) * Select "tech-lab" as network (by scrolling through the list). * If "Status: Online" or Status: Connected" appears, everything is fine. * Else: * Select "Connect". * Press enter key in empty password field. * Enter password "tech-lab"! (Use arrow keys and enter key to select characters, use Escape key for deleting) * Finish with OK/enter. * Select "Accept". * go back with "ESC" to main menu ===== In VS Code ===== * Install "Lego mindstorms EV3 Micropython" extension: {{:lehrkraefte:sbt:informatik-glf2-22:ev3-extension-logo-vscode.png?400|}} * Make sure to be connected to "tech-lab" by WLAN. * Open the command palette (Ctrl+Shift+p). Enter "ev3dev" and choose "ev3dev: Connect to a device". * Enter IP address as name (click "I don't see my device"). * Enter IP address. * Switch to Explorer panel (on left side of VS Code). * Open "EV3 DEV DEVICE BROWSER" at the bottom of this panel. * There should be a green bullet indicating that the connection works. Open to see battery status etc. ===== Your first robotics program ===== (using micropython = small version of python) * New lego icon on left side. Click on the icon and choose to open new project or explore example projects. * e.g. open example project, see screenshot for sending to device ACHTUNG: EINFACHER WOHL DIREKT Ctrl+F5, LÄDT WOHL AUCH HOCH. {{:lehrkraefte:sbt:informatik-glf2-22:roboter-send-to-device.png?200|}} * start by clicking on program, e.g. on ''main.py'' in screenshot {{:lehrkraefte:sbt:informatik-glf2-22:roboter-starten-von-vscode.png?200|}} * Can run program autonomously from robot: Press "Escape" several times, "File browser" etc. ===== See also ===== * Use Examples from Lego Mindstorms extension (have to change motor ports to A and B and sensor port (Ultrasonic) to S2. * Achtung: pybrick.pupdevices macht Probleme * [[https://pybricks.com/ev3-micropython|ev3-micropython]] * [[https://docs.pybricks.com/en/stable/|Documentation]] * https://pybricks.com/ev3-micropython/startinstall.html