00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <config.h>
00017 #if defined(CONF_DSENSOR) && defined(CONF_DSENSOR_VELOCITY)
00018
00019 #include <c++/RotationSensor.H>
00020 #include <conio.h>
00021 #include <unistd.h>
00022
00023
00025 int
00026 main(int argc,
00027 char **argv)
00028 {
00029 RotationSensor r(RotationSensor::S2, 0);
00030
00031 while (!shutdown_requested()) {
00032 #ifdef CONF_DSENSOR_VELOCITY
00033 cputw(r.velocity());
00034 #else
00035 cputw(0xffff);
00036 #endif
00037 delay(1000);
00038 }
00039 return 0;
00040 }
00041 #else
00042 #warning rotation.velocity.Sensor.C requires CONF_DSENSOR and CONF_DSENSOR_VELOCITY
00043 #warning rotation.velocity.Sensor.C demo will do nothing.
00044 int
00045 main(int argc,
00046 char **argv)
00047 {
00048 return 0;
00049 }
00050 #endif // defined(CONF_DSENSOR) && defined(CONF_DSENSOR_VELOCITY)