Posted January 22, 20196 yr 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!
January 22, 20196 yr 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.
January 22, 20196 yr 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.
January 22, 20196 yr You can also "spy" on the values being read, what does that look like? I think your approach looks valid.
January 22, 20196 yr 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.
January 23, 20196 yr 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.
January 23, 20196 yr 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.
January 24, 20196 yr Author Tried it - AND IT WORKS!!! Thank you so much. I was jumping around I was so lucky.
January 27, 20196 yr 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
January 27, 20196 yr 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
January 28, 20196 yr you dont need bluetooth with the new software you can use usb to connect it to the nxt. XGBC
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.