Basic Phidget Sonar Example

From wikidb
Revision as of 12:08, 25 November 2008 by Edc (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 #include <iostream>
 #include <libplayerc++/playerc++.h>
 int
 main(int argc, char *argv[])
 {
   using namespace PlayerCc;
   PlayerClient    robot("localhost");
   AioProxy        ap(&robot,0);
   int             i = 0;
   // Read the 8 digital inputs
   for(i=0; i<30; i++)
   {
     robot.Read();
     std::cout << ap[1] << "  " <<
                  ap[2] << "  " <<
                  ap[3] << "  " <<
                  ap[4] << "  " <<
                  ap[5] << "  " <<
                  ap[6] << "  " <<
     std::endl;
     sleep(1);
   }
 }