Fun Projects for your LEGO® MINDSTORMS® NXT! |
|
The built-in gyro sensor in the LEGO MINDSTORMS Inventor hub allows a program to sense the angular direction of the hub (in all three axes: roll, pitch, and yaw). This can be used to make a robot drive straight in a certain direction or turn more reliably by a certain angle, for example. There appears to be a bug in the internal gyro software that makes it not work sometimes. For example, it might always report a yaw angle of 0, no matter what direction the robot is facing, which will cause incorrect results in your programs that try to use the gyro. I'm not sure what causes the bug or exactly what circumstances trigger it, but in practice it frequently happens when you power up the hub not connected to your programming computer/device and try to run an already-downloaded program on it. However, if you connect the hub to a computer via a USB cable, power it up, and download or run the program while connected, it will work. If you have trouble with a program using the gyro, try this workaround:
|
Copyright
©
2007-2021 by Dave Parker. All rights reserved. |