encoder.cpp
00001
00002
00003
00004
00005
00006
00007 #include "runCtrl.h"
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010
00011
00012 int main(int argc, char *argv[]) {
00013 RunCtrl run;
00014 if (run.connect(argc, argv) < 0) {
00015 printf("RunCtrl::connect: %s\n", run.what());
00016 exit(1);
00017 }
00018
00019 unsigned long pre = VXV::GetTicks();
00020 for (int i = 0; i < 20; ++i) {
00021 int enc_vel;
00022
00023
00024
00025
00026
00027
00028 unsigned long now = VXV::GetTicks();
00029 long diff = now - pre;
00030 printf("enc_vel: %d, ticks: %lu (%ld)\n", enc_vel, now, diff);
00031 pre = now;
00032 VXV::Delay(1000);
00033 }
00034
00035 return 0;
00036 }
00037