yaw sensor

How does the yaw sensor work? What output does it give, and what would I put in the Serin to accept its values?


To use the gyro, attatch the wires to the analog input port on the robot controller. To learn what wires go in what pins, look at the datasheet for both the gyro and the robot controller. To receive input in the program, look in the default program for a section that looks like:

Uncomment the variable corresponding to the one you soldered the gyro into. The robot controller datasheet should tell you which variable to use based on what pin you soldered it into. Then go into the constants section and set
c_SensorX CON 1

Finally, add the SensorX (x = the number your choose) to the serin in the correct place, and you are done. The value stored in SensorX will be a number 0 - 254 (or 255? doesn’t really matter). 127 is no angular velocity. 254 is the maximum angular velocity the gyro can record in one direction, which I think I heard was around 75 deg / sec. 0 is maximum angular velocity in the other direction.

If you are having trouble attaching wires to the gyro, there are other threads in here on that, but I would recommend cutting some of that cover off to get more access to the pins, then soldering wires directly on.