kenchoi316

Hi everyone, I want to use distance sensors in Lego EV3 to read the distance and to be used in the programme.

However, I can't have any value read in Scratch, I wanted to do a program like: when the distance <30, sth will happen.

I have no problem with connecting scratch to EV3. My scratch can connect to EV3, and the sensors are working properly as when I go to port view in EV3, the distance is constantly measured.

The only problem is scratch can't make use of the value, please help.

Ken

kenchoi316

Can anyone help?

kenchoi316

can anyone answer me/>?

jolackner

Hi,
I can report the same problem. Tried two different distance sensors that normally work well - but Scratch doesn't read any values from them.

jolackner

Hi @kenchoi316,
it might be a problem specific to NXT sensors. They are compatible with the EV3 platform itself, but Scratch 3.0 seems to have a problem reading the signals of those slightly older sensors.
After two NXT distance and color/brightness sensors did not work with Scratch (see above post), I bought a EV3 color sensor that now works flawlessly on Scratch 3.0.

W1nterGh0st

what does the distance and brightness mean?
i dont have a mind storm

W1nterGh0st

nevermind
go here if you need help
https://en.scratch-wiki.info/wiki/LEGO_Mindstorms_EV3_Extension

Timasun

I have exactly the same problem. This is the ir distance sensor - https://www.lego.com/en-us/product/ev3-infrared-sensor-45509
P-brick has the latest firmware 1.09H

echeetham

Late response, but for me this is a problem with using port view on the brick.

Sensor outputs (distance and brightness) are fine on the port view (on the brick screen) but are intermittent/zero in Scratch - no use for controlling code. Turn off port view on the brick and the values are updated real time in scratch - (select the check next to the distance and brightness blocks to see real-time values).

brinknicoh

hello I have another question about how you can use other sensors

brickcodelab

Some examples of using the distance sensor. Maybe it will be useful to someone:
https://www.youtube.com/watch?v=sRTocRVBCsM