Skip to content

Commit

Permalink
Added print fail
Browse files Browse the repository at this point in the history
  • Loading branch information
robinsp committed Oct 29, 2025
1 parent c58ff86 commit d02e8d6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion py/src/drive.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Fil for programmering av kjøring
#!/usr/bin/env pybricks-micropython
from pybricks.hubs import EV3Brick
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
InfraredSensor, UltrasonicSensor, GyroSensor)
Expand Down
21 changes: 14 additions & 7 deletions py/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,31 @@
from pybricks.robotics import DriveBase
from pybricks.media.ev3dev import SoundFile, ImageFile

from drive import Drive
from sensors import Sensors
from robot import Robot

try:
from drive import Drive
from sensors import Sensors
from robot import Robot

except Exception as e:
ev3 = EV3Brick()
ev3.screen.print("Failed to import: ", e)


# This program requires LEGO EV3 MicroPython v2.0 or higher.
# Click "Open user guide" on the EV3 extension tab for more information.

dimensions = ( # Wheel diamter
) #Axle track
dimensions = ( 20, # Wheel diamter
20 ) #Axle track

motors = (Motor(port=Port.D), # Left motor for the drive base
Motor(port=Port.A)) # Right motor for the drive base
Motor(port=Port.C)) # Right motor for the drive base

sensors = (ColorSensor(port=Port.S1), # Lyssensor for å måle fargen på jorda
UltrasonicSensor(port=Port.S2)) # Ultrasonisksensor for å sjekke for potensielle hindringer robotten må navigere unna
UltrasonicSensor(port=Port.S4)) # Ultrasonisksensor for å sjekke for potensielle hindringer robotten må navigere unna

robotDrive = Drive(motors, dimensions) # Robottens kjørefunksjonalitet
robotSensors = Sensors(sensors) # Robottens sensorfunksjonalitet

robot = Robot(robotDrive, robotSensors) # EV3 robot
robot.start()
1 change: 0 additions & 1 deletion py/src/robot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#Overklasse for all robot funksjonalitet
#!/usr/bin/env pybricks-micropython
from pybricks.hubs import EV3Brick
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
Expand Down
1 change: 0 additions & 1 deletion py/src/sensors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#!/usr/bin/env pybricks-micropython
from pybricks.hubs import EV3Brick
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
Expand Down
1 change: 0 additions & 1 deletion py/src/water_bucket.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#!/usr/bin/env pybricks-micropython
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
InfraredSensor, UltrasonicSensor, GyroSensor)
Expand Down

0 comments on commit d02e8d6

Please sign in to comment.