Recommended Posts

Hi

I'm rather new to Lego robotics and new to this forum. I found some old NXT stones and set them up. It was fun to start with but I wanted to proceed to a project with two inputs.

My problem is that I want the ultrasonic and light sensor to check wether the robot is about to fall off the table. Each of the sensors by themselves work, but I can not get it running with both at the same time.

I have my latest of many tries attached. Any suggestions? Thanks a lot!

Share this post


Link to post
Share on other sites

Hi duplexo123, I can't see the attachment, maybe you need to have more post before you can add an attachment? You could add it on Flickr and add it then as an image.

Share this post


Link to post
Share on other sites

You can also "spy" on the values being read, what does that look like? I think your approach looks valid.

Share this post


Link to post
Share on other sites
10 hours ago, JopieK said:

You can also "spy" on the values being read, what does that look like? I think your approach looks valid.

I cannot upload it. There was an error message (should have taken a picture). I try to reconstruct it tommorow.

Share this post


Link to post
Share on other sites

The dashed lines indicate that you are trying to wire incompatible variable types.  I'm not where I can confirm at the moment, but I believe in your case you are trying to wire two number values into a block that is expecting logic (yes/no) values.  I think the default wire output for the light sensor block is the actual light value being read and the default for the ultrasonic block is the distance (in inches or mm) read.  To do what you want, you should be able to click on the sensor blocks and get them to expand the wire port options.  Try clicking right at the bottom of the square part of the sensor block, just above where you clicked to start your data wire.  Done correctly the block will expand downward with a whole bunch more options for things you can wire in & out of the sensor blocks.  On each one there should be a logic output wire that you can wire into your logic block.  You will also have to set the trigger value of each to determine when the sensor is "triggered" causing it to output a true vs false value.  You will be able to do this via the configuration panel at the bottom of the NXT-G screen or via wiring in a variable to the sensor block.

Share this post


Link to post
Share on other sites

I go tomorrow to the place where I stored and try it - had no time today. So far it looks awesome though. Didn't know that those lines had a meaning.

 

1ExKcb3.png

Share this post


Link to post
Share on other sites

oh my god the nxt programming language looks so complikated compared to the one from the ev3. in the one from the ev3 you dont have to worry about conversions and it schould work with nxt too however im not shure if it does.

XGBC

Share this post


Link to post
Share on other sites
1 hour ago, XGBC said:

oh my god the nxt programming language looks so complikated compared to the one from the ev3. in the one from the ev3 you dont have to worry about conversions and it schould work with nxt too however im not shure if it does.

XGBC

It does - however the new iOS on my Macbook didn't support the bluetooth connection. So I pulled out an old macbook and it worked. At some point I need to switch I guess :purrr:

Share this post


Link to post
Share on other sites

you dont need bluetooth with the new software you can use usb to connect it to the nxt.

XGBC

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.