SOLVED: Using sound sensor and light sensor at the same time

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
nunzilla
Posts: 5
Joined: 11 Oct 2010, 18:30

SOLVED: Using sound sensor and light sensor at the same time

Post by nunzilla »

Hi friends,

I am making a "racing robot" (standard driving base) which will be used at a charity event.
I use NXT-G to program.

My robot has a randomly generated number between 10 and 50 which represents the starting motor power. That's outside my loop. Then, inside a loop, because my robot "responds" to applause and cheering, the sound sensor generates a second number (decibel % as detected by the sound sensor) which is added to the randomly generated number and this value is passed to the motor block. Close loop. Everything's great, my robot surges ahead when its "jockey" is behind it clapping and cheering, and slows down when it's quiet. BUT... what I would like to do is add a Wait block so that when my robot crosses the (dark) finish line, it automatically stops (motor stop block).

I know how to do either the sound sensor in an endless loop as I've described, or the dark-line detection using the wait block, but how can I combine them? If I put the wait block and motor stop blocks inside the loop, my robot just starts up again... if I put it outside the block it will never get there... I have tried doing a parallel beam and even that doesn't work.

I tried to attach my .rbt files (one is my random number speed plus stopping at black line, one is random number speed that gets upped by the noise level), but I can't attach .rbt... I'll check the FAQ and repost with attachments if I can.

Thanks for the help!
Nunzilla
the NXT nun
Last edited by nunzilla on 12 Oct 2010, 12:22, edited 1 time in total.
sebi-mylegopage
Posts: 16
Joined: 29 Sep 2010, 13:47
Location: Germany
Contact:

Re: Using sound sensor and light sensor at the same time

Post by sebi-mylegopage »

Set the loop value like this:
Attachments
lightloop.JPG
(119.1 KiB) Downloaded 97 times
nunzilla
Posts: 5
Joined: 11 Oct 2010, 18:30

Re: SOLVED: Using sound sensor and light sensor at the same time

Post by nunzilla »

Thanks, sebi-mylegopage! Danke! Merci vielmal! That's exactly what I needed....

Pax
Nunzilla
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 10 guests