Jump to content
THIS IS THE TEST SITE OF EUROBRICKS!
THIS IS THE TEST SITE OF EUROBRICKS!

Featured Replies

Posted

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!

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.

  • Author

@JopieK Thank you so much for the reply. Seems like the upload didnt work.

I uploaded it onto here. Hopefully it works this time.

SrCfXxH.jpg

  • Author
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.

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.

  • Author

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

  • Author

Tried it - AND IT WORKS!!!

 

Thank you so much. I was jumping around I was so lucky.

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

  • Author
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:

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

XGBC

  • Author

Bluetooth is a nice add-on. I like to have no cable when trying my cmds

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.
Sponsored Links