This page created 11-23-2002
Back to Index
Click thumbnails for a larger view.
Trippy's sensors
He usually does the connector soldering while I try and figure out how to talk to the particular sensor using the motorobots library.
Six hours later....
We had the gyrocompass working. And it only took this much code:
void
setup_gyro() {
PTAObjectP pta;
ServoObjectP servo;
/*
* Configure TPU channel #3 to generate a 1 millisecond pulse
* every 20 milliseconds or so. These are the default settings
* for the servo routines.
*/
servo = servo_init(3);
servo_powered(servo,TRUE);
/*
* Configure TPU channel #2 to capture the time the input pin is
* low, and call the routine catch_period(time) with that time.
*/
pta = tpu_pta_init(2,MODE2,TCR1,1,&catch_period);
tpu_pta_execute(pta);
}
void
catch_period(uint32 value) {
/*
* Print out the time that TPU pin #2 has been low
*/
printf("%d\n",value);
}
Back to Index
Back to Alan's home page http://www.pobox.com/~kilian
Back to Jeff's home page http://www.pobox.com/~jsampson
Visit Twin Cities Robotics Group
This page is currently maintained by Alan Kilian