Skip to content

Finding the ev3dev libary and cwiid #539

Closed
@Will2004

Description

@Will2004

hi i am wondering how i can control my robot via a wiimote is there any code that you can send to me about how to do this

I am also wondering on how to fix the error no module named ev3dev.motor or ev3dev.sensor because it is not working. i know how to get my projects onto the robot but the hard thing is that when i run them on the robot they go straight back to the project selector screen. i did the touch sensor project that is shown on the example. I did this:

from ev3dev2.motor import LargeMotor, OUTPUT_A, OUTPUT_B, SpeedPercent, MoveTank
from ev3dev2.sensor import INPUT_1
from ev3dev2.sensor.lego import TouchSensor
from ev3dev2.led import Leds

ts = TouchSensor(INPUT_1)
leds = Leds()

print("Press the touch sensor to change the LED color!")

while True:
if ts.is_pressed:
leds.set_color("LEFT", "GREEN")
leds.set_color("RIGHT", "GREEN")
else:
leds.set_color("LEFT", "RED")
leds.set_color("RIGHT", "RED")

but it comes up saying no module named ev3dev2.motor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions