Support of HiTechnic Color Sensor V2 in pybricks-micropython #345
-
Hi! EDIT: my sensor is HiTechnic Color Sensor V2 I'm having problems with using NXT Color Sensor V2 with pybricks. I have an NXT Color Sensor V2 connected to S1 of the EV3 brick. #!/usr/bin/env pybricks-micropython
from pybricks.nxtdevices import ColorSensor
from pybricks.parameters import Port
color_sensor = ColorSensor(Port.S1) When I run this code on my EV3 brick, it just hangs, I have to stop the program manually. Also, as you can assume that if I write something like this: #!/usr/bin/env pybricks-micropython
from pybricks.nxtdevices import ColorSensor
from pybricks.parameters import Port
color_sensor = ColorSensor(Port.S1)
color_sensor._mode('RGB-RAW') The last line of code The Question: P.S. I've seen this comment #102 (comment) by @dlech, but I don't understand how I can make this work for my case, that it seems like color_sensor object isn't being created. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The NXT color sensor class used in the script above is for the NXT color sensor that comes in the NXT set (https://docs.pybricks.com/en/latest/nxtdevices.html#nxt-color-sensor). Could it be that you are using the HiTechnic Color Sensor V2 instead? Then you can use this class and its examples: |
Beta Was this translation helpful? Give feedback.
The NXT color sensor class used in the script above is for the NXT color sensor that comes in the NXT set (https://docs.pybricks.com/en/latest/nxtdevices.html#nxt-color-sensor).
Could it be that you are using the HiTechnic Color Sensor V2 instead? Then you can use this class and its examples:
https://docs.pybricks.com/en/latest/iodevices/ev3devsensor.html