Sets patterns on digital outputs and acts on digital inputs. Attach LEDs to the outputs and buttons to the digital inputs to use. (See the Pioneer LX manual and robots.mobilerobots.com for more details.) The 'mtx' Linux kernel module must be loaded, and the /dev/mtx character device must have been created (see mtxIODriver documentation). You must have read/write access to /dev/mtx.
#include "Aria.h"
#include "ArMTXIO.h"
void printBits(unsigned short c) {
int i;
for (i=0; i < 16; i++) {
if (i == 8) {
}
if (0x8000 & (c << i)) {
}
else {
}
}
}
int main(int argc, char **argv)
{
{
{
}
}
{
}
robot.
comInt(ArCommands::JOYINFO, 0);
{
}
unsigned char out = 1;
while(true)
{
unsigned char inp;
mtxIO.getDigitalInputMon1(&inp);
printBits(inp);
mtxIO.getDigitalInputMon2(&inp);
printBits(inp);
if(!mtxIO.
setDigitalOutputControl1(&out))
{
}
if(!mtxIO.
setDigitalOutputControl2(&out))
{
}
out = out << 1;
if(out == 0) out = 1;
}
out = out << 1;
if(out == 0) out = 1;
}
}