Page 1 of 1

NXT / problem with 2 colour sensors

Posted: 25 Oct 2013, 16:16
by legojoentje
Hi,

My FLL team is running into a problem:
We're trying to make a linefollower, with 2 colour sensors.
When both see White, the robot goes straight on.
When one of them sees Black, the robot turns.

This all worked fine.

But then, well, I don't know what happened.
All of a sudden only one colour sensors works.
We checked all connections, and they work; when using View on the NXT both of them work fine (but not simultaneously, obviously)
We even replaced NXT with a spare one.
But when running the program, only one of them works (led emitting light). Sometimes the left one, sometimes the right one.

Any hints on what can be going on are much appreciated!

Re: NXT / problem with 2 colour sensors

Posted: 25 Oct 2013, 21:58
by legojoentje
I've been testing for a couple of hours this evening, and I've concluded that both sensors work, and simultaneously as well.
I've made a little state machine with nested conditions, to make 4 states in total. (All that within an infinite loop).

If the only thing in the states is a Display Block (displaying the state it is in, basically) it all works as expected.

But if I have move blocks in there as well, it seems that things get mixed up.
For instance: when sensor 3 sees black and sensor 4 sees white, it reports to be black-black!

What on earth is going on?
Are the sensors signals influenced by the motors? Is that possible?

This is sooooooooo frustrating!

Any thoughts?

Re: NXT / problem with 2 colour sensors

Posted: 26 Oct 2013, 03:44
by loopymech
Can you provide some specifics about the type of color sensors you are using and the code that fails?

Cheers,
Loopy

Re: NXT / problem with 2 colour sensors

Posted: 26 Oct 2013, 10:03
by legojoentje
We're using standard LEGO color sensors from 2 NXT2.0 Retail kits.
Software in the Mindstorms programming environment that cam in the box;
Drag & drop, don't know how to share that here?

Re: NXT / problem with 2 colour sensors

Posted: 26 Oct 2013, 15:22
by loopymech
Can you try posting a screenshot of the code? It's been a while since I've used nxt-g but there is also something called "pack and go" that lets you bundle the files so you can share them (...as an attachment?).

Re: NXT / problem with 2 colour sensors

Posted: 26 Oct 2013, 16:14
by legojoentje
I'll give that a go tonight!
Thnx for thinking with me!