Set_minimum for distance sensor

Hi,

I noticed that RobotC has the ability to set both the minimum and maximum bounds on a distance sensor, but that RobotMesh only has the ability to set the maximum. Would it be possible to add support for minimum as well?

Thanks!
Nathan

1 Like

Hi Nathan.

I wasn’t aware we had a class method for setting the max range on an ultrasonic sensor. Which programming language and platform are you looking at?

1 Like

Looks like it may only be in the beta SDK
Language: Python
Class: sonar
Function: set_maximum
set_maximum

1 Like

Neat. The peril of supporting so many languages is that you might lose track of what does what, apparently.

If such a method existed, as a user of that method, what would you expect a distance() call to return if it was below minimum?

0? -1? None? NaN? Something else?

1 Like

In RobotC it appears to be returning Max Int. NaN would probably be a better way of saying that, if that’s doable in blockly. Negative numbers are also better than a max int imho.

1 Like