NXC: 4 US sensors at 1 HT SensorMux in single shot mode?

Discussion specific to the intelligent brick, sensors, motors, and more.
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

NXC: 4 US sensors at 1 HT SensorMux in single shot mode?

Post by HaWe »

how can we use several (4) Lego US sensors at 1 HT SensorMux in single shot mode (by NXC)?
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: NXC: 4 US sensors at 1 HT SensorMux in single shot mode?

Post by HaWe »

no ideas anyone?
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: NXC: 4 US sensors at 1 HT SensorMux in single shot mode?

Post by mightor »

That one is easy, you can't. The HT Sensor MUX does not allow you to write to the sensor, so it uses the standard mode which is continuous.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: NXC: 4 US sensors at 1 HT SensorMux in single shot mode?

Post by HaWe »

...and configure a specific i2c reading or writing by specific ports, messages, bytes that lets the mux do things with any kind of general i2c sensor, not "knowing" that it's addressing a LegoUS (hope I could express myself comprehensibly) ?
(hmm - probably not, I guess, otherwise you had suggested that workaround by your own, but I do understand too little about i2c commands)
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: NXC: 4 US sensors at 1 HT SensorMux in single shot mode?

Post by mightor »

You cannot send commands of any kind to a sensor connected to the Sensor MUX. It can only read a sensor connected to it. You can tell the MUX which register to read and how many bytes but nothing more. It's read-only, that means no writing :)

Trust me, if there was a way around it, I would've used it.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: NXC: 4 US sensors at 1 HT SensorMux in single shot mode?

Post by HaWe »

Frustrating, but I certainly do^^

I may redesign my sensor architecture for a different solution, so another question, admittedly OT -
but can you (or even anyone else) tell me if there is a way to use

1 Lego US sensor
1 HT compass sensor
1 HT accelerometer

altogether at 1 port splitter in order to use the US sensor in single shot mode (the single shot function I already got working)?
(by disabling the pullups by software at 2 of the sensors and of course adjusting all i2c address registers accordingly)
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: NXC: 4 US sensors at 1 HT SensorMux in single shot mode?

Post by mightor »

In short: no.

Long story: the HT sensors do not support having their I2C address changed or their pull-ups disabled.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: NXC: 4 US sensors at 1 HT SensorMux in single shot mode?

Post by HaWe »

:evil:
loopymech
Posts: 35
Joined: 30 Sep 2010, 15:35

Re: NXC: 4 US sensors at 1 HT SensorMux in single shot mode?

Post by loopymech »

Hi Doc,

I had a thought about a work-around for your US sensor/mux problem... At the cost of a motor and motor port, you could rotate a single US sensor in a +/- 180 deg sweep back and forth to get full radius 'look around'. You could even use a sensor mux, since no interference means you don't need single-shot mode.

Not sure at all if that method would work for your particular needs or application, but thought it worth suggesting.


Cheers,

LoopyMech
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: NXC: 4 US sensors at 1 HT SensorMux in single shot mode?

Post by HaWe »

of course I know that, but it's not possible because of the size and the architecture of the robot ( e.g. a big, 80cm high and up to 110cm long 5 DOF rotating robot arm in the middle with a 25-135 cm forward projecting gripper)
I have 6 USS to control (for object and obstacle size and localization detection), at least 3 have to be controlled by single shot mode (these three forwards are aligned in different heights), and I also got no motor port left for rotating (I have already 9 NXT motors and 18+ sensors to attach to 3 NXT bricks working "scaled" altogether in a BT network)
:evil:
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests