From e72b4aa951b1fcf5510e017ba483463c05f53374 Mon Sep 17 00:00:00 2001 From: Martin Aronsen Date: Fri, 5 Sep 2025 13:13:48 +0200 Subject: [PATCH] Satt opp ev3 mappe --- oving_3/.gitignore | 3 +++ oving_3/.vscode/extensions.json | 13 +++++++++++++ oving_3/.vscode/launch.json | 15 +++++++++++++++ oving_3/.vscode/settings.json | 7 +++++++ oving_3/main.py | 20 ++++++++++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 oving_3/.gitignore create mode 100644 oving_3/.vscode/extensions.json create mode 100644 oving_3/.vscode/launch.json create mode 100644 oving_3/.vscode/settings.json create mode 100644 oving_3/main.py diff --git a/oving_3/.gitignore b/oving_3/.gitignore new file mode 100644 index 0000000..00f2d38 --- /dev/null +++ b/oving_3/.gitignore @@ -0,0 +1,3 @@ +__pycache__/ +*.pyc +.venv/ diff --git a/oving_3/.vscode/extensions.json b/oving_3/.vscode/extensions.json new file mode 100644 index 0000000..f8f1a44 --- /dev/null +++ b/oving_3/.vscode/extensions.json @@ -0,0 +1,13 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "lego-education.ev3-micropython" + ], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [ + "ms-python.python" + ] +} \ No newline at end of file diff --git a/oving_3/.vscode/launch.json b/oving_3/.vscode/launch.json new file mode 100644 index 0000000..d933aeb --- /dev/null +++ b/oving_3/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Download and Run", + "type": "ev3devBrowser", + "request": "launch", + "program": "/home/robot/${workspaceRootFolderName}/main.py", + "interactiveTerminal": false + } + ] +} diff --git a/oving_3/.vscode/settings.json b/oving_3/.vscode/settings.json new file mode 100644 index 0000000..b0968c1 --- /dev/null +++ b/oving_3/.vscode/settings.json @@ -0,0 +1,7 @@ +// Place your settings in this file to overwrite default and user settings. +{ + "files.eol": "\n", + "debug.openDebug": "neverOpen", + "python.linting.enabled": false, + "python.languageServer": "None" +} diff --git a/oving_3/main.py b/oving_3/main.py new file mode 100644 index 0000000..9e9700f --- /dev/null +++ b/oving_3/main.py @@ -0,0 +1,20 @@ +#!/usr/bin/env pybricks-micropython +from pybricks.hubs import EV3Brick +from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor, + InfraredSensor, UltrasonicSensor, GyroSensor) +from pybricks.parameters import Port, Stop, Direction, Button, Color +from pybricks.tools import wait, StopWatch, DataLog +from pybricks.robotics import DriveBase +from pybricks.media.ev3dev import SoundFile, ImageFile + + +# This program requires LEGO EV3 MicroPython v2.0 or higher. +# Click "Open user guide" on the EV3 extension tab for more information. + + +# Create your objects here. +ev3 = EV3Brick() + + +# Write your program here. +ev3.speaker.beep()