New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NXT Color Sensor support? #1553
Comments
The NXT color sensor is an unusual sensor in that it has a protocol unlike any other sensor. They only way to use it with ev3dev is with Pybricks (or port this code to the language of your choice). |
I tried Pybricks and got the same result. Any other suggestions? |
Can you share the code to reproduce the problem? |
I haven't gotten to the point of writing any code yet. When I connect the NXT color sensor and boot using EV3DEV, then go into Device Browser/Sensors, the sensor does not show as connected. And I am a little confused. When I go to pybricks.com, it says the ev3 brick isn't supported, but when I go to https://pybricks.com/ev3-micropython/ it says it is, but using MicroPython, not Pybricks. I followed the instructions to create the flash and set up MicroPython. Is that the same as Pybricks? If not, where do I find Pybricks for the EV3? |
When I try to initialize the NXT color sensor using MicroPython using: color_sensor = ColorSensor(Port.S1) I get the error: A sensor or motor is not connected to the specified port |
It cannot be automatically detected and there is no kernel driver for it, so this sensor will never display in the device browser. The Pybricks library takes care of properly configuring the port when you run your program.
Pybricks is built on top of MicroPython, so they are basically the same thing in this context.
It is pre-installed on ev3dev. Just use
Can you share the full program to reproduce the problem? |
This is the entire code: #!/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
ev3 = EV3Brick()
ev3.speaker.beep()
color_sensor = ColorSensor(Port.S1) |
This is the NXT color sensor, so you need |
Wow. Sorry I missed that. Thank you so much! |
So I tried porting it to java with chatGPT, but I don't know if it's correct
|
ev3dev version: 4.14.117-ev3dev-2.3.5-ev3
ev3dev-lang-python version:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
ii micropython-ev3dev2 2.1.0 all Python language bindings for ev3dev for MicroPython
ii python3-ev3dev 1.2.0 all Python language bindings for ev3dev
ii python3-ev3dev2 2.1.0 all Python language bindings for ev3dev
I am trying to use an NXT color sensor, but I can't get the EV3 brick to recognize it. I know the sensor is good, because if i boot the EV3 into the default firmware from Lego the sensor is detected and work properly, but when I boot to EV3DEV and check Device Browser/Sensors the sensor does not show. Note that this is the NXT color sensor, 4546542, that comes with the NXT 2.0 kit, not the ambient light sensor. Is this sensor supported? Thanks!
The text was updated successfully, but these errors were encountered: