Nxc ultrasonic sensor program




















I guess Lsxxx queries are of the same sort in that they use the I2C bus to get the data? Do you have any ideas? Is it my brick that's at fault? Is the error code a known error? That's a tricky one and I'm stuck for the moment so thank you for your suggestions.

Unfortunately it is hard to say for sure how to resolve it completely. As for me I was able to get more or less good results making a small pause after setting sensors mode and before reading its first value. It looks like the I2C device or bus may need some time to initialize, so don't start reading values right after setting device's mode.

By the way, there was a note about this in docs Edit: Sorry I forgot to close the subject! Acceleration Sensor VI 1 downloads. Color Sensor VI 1 downloads. Compass Sensor VI 1 downloads.

IRSeeker VI 1 downloads. Gyro Sensor VI 1 downloads. Prototype Sensor VI 1 60 downloads. Touch Sensor Multiplexer VI 1 99 downloads. Beta Test of Blocks and Other Downloads. HiTechnic Magnetic Sensor Viewer 1 downloads. LDraw Parts Pack for Rotacaster wheels 1 downloads. Search this site. How I started. My first programs. NXC and Mindstorms. Energy Project I.

I wrote some programs for it. Here are some examples:. Viewed 3k times. I can provide more information if necessary. I hope I'm okay in asking this here, it really is my last effort.

This is the full code: This is the code inside each loop:. Improve this question. Brandon Sidoti Brandon Sidoti 1 1 1 silver badge 1 1 bronze badge. Can you provide the code? It sounds like you need to check both sensors in one "spin seek destroy back up" loop. SantaClaus I'm not sure what you mean by checking both sensors in one loop. Would that not make it impossible to tell the robot which direction to move if both sensors are getting checked in one loop?

Can you rather update your question with these pictures? Show 1 more comment. Active Oldest Votes.



0コメント

  • 1000 / 1000