Program for testing the Homing mode using a sensor
- Author
- Marti Morta Garriga - IRI (CSIC-UPC)
- Date
- february 2011 (last revision)
This program sets a digital input, in this case number 4 (default) (pin 5) as a home position and tests it,
Change the parameters of the example is trivial.
#include <stdio.h>
#include <unistd.h>
#include <iostream>
#include <bitset>
cout << "Epos2 Homing:" << endl;
try{
cout << " DIGITAL INPUTS:\n";
for(int i=1;i<=10;i++)
cout <<
" DigIN " << i <<
": " << controller.
getDigInState(i) << endl;
cout
<< "\n";
cout << " Home is done!\n\n";
}catch(std::exception &e){
cout << e.what() << endl;
}
return 1;
}