From f5a8782e6c73b5edf8cb3fa8ed893230dd64ad93 Mon Sep 17 00:00:00 2001 From: Martin Aronsen Date: Wed, 3 Sep 2025 10:22:33 +0200 Subject: [PATCH] Laget prosjekt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Satt opp et ev3 mindstorms prosjekt i python øving 2 --- .DS_Store | Bin 0 -> 6148 bytes oving_2/.gitignore | 3 +++ oving_2/.vscode/extensions.json | 13 +++++++++++++ oving_2/.vscode/launch.json | 15 +++++++++++++++ oving_2/.vscode/settings.json | 7 +++++++ oving_2/main.py | 20 ++++++++++++++++++++ 6 files changed, 58 insertions(+) create mode 100644 .DS_Store create mode 100644 oving_2/.gitignore create mode 100644 oving_2/.vscode/extensions.json create mode 100644 oving_2/.vscode/launch.json create mode 100644 oving_2/.vscode/settings.json create mode 100644 oving_2/main.py diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c141d4052d8cd825ae1b7040e71a7f2ad50c396a GIT binary patch literal 6148 zcmeHKO;6iE5SGq-n2hRLw}UZ+3RZUO%sPcZf)}MoELHMnn}TW64MJ8{u)*IVm|$8K}%N zE~!I}<4pgEv$<$-EFuH^?>y3UM=9m>?*Hi+BfKmQpcBfOnvbM2(aN4=f zZgTz8%$pR}sF4p2U*R6cFC5%O{XEn8B}O>Qr&Brt6Ky&HZqW@Tc9p-e^nj@METJnR z3Y8Ue3Cm`=RS_l+5mb1W#PEO;#&#~a}*<%kK%Qx5%>c( VfT6>}B0Lbe2pAfq5eEJ$120K-WX%8o literal 0 HcmV?d00001 diff --git a/oving_2/.gitignore b/oving_2/.gitignore new file mode 100644 index 0000000..00f2d38 --- /dev/null +++ b/oving_2/.gitignore @@ -0,0 +1,3 @@ +__pycache__/ +*.pyc +.venv/ diff --git a/oving_2/.vscode/extensions.json b/oving_2/.vscode/extensions.json new file mode 100644 index 0000000..f8f1a44 --- /dev/null +++ b/oving_2/.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_2/.vscode/launch.json b/oving_2/.vscode/launch.json new file mode 100644 index 0000000..d933aeb --- /dev/null +++ b/oving_2/.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_2/.vscode/settings.json b/oving_2/.vscode/settings.json new file mode 100644 index 0000000..b0968c1 --- /dev/null +++ b/oving_2/.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_2/main.py b/oving_2/main.py new file mode 100644 index 0000000..9e9700f --- /dev/null +++ b/oving_2/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()