Skip to content
albeaver edited this page Jan 5, 2018 · 3 revisions

Necessary Configuration

Power variables

To implement correctly, create a variable for your motor power. For example, int motorpower; and set your intended value to motorpower. Then set your motor to that variable and post it to the library.

int motorpower;

motorpower = 127;

motor[port1] = motorpower;

AR_GenerateMotorPower(port1,motorpower);

Functions

AR_BEGINSegment();

Description

AR_BEGINSegment goes at the top of your while loop for driver control. It does all of the things necessary at the beginning of the loop.

Usage

while(true){

AR_BEGINSegment();

AR_GenerateMotorPower(motor, power);

Description

AR_GenerateMotorPower adds the motor power to the queue. You have one of these for each motor

Usage

motor[leftBack]=leftpower; //leftpower has been previously set

AR_GenerateMotorPower(leftBack,leftpower); //leftBack is defined as a motor in the Motor and Sensor Setup

AR_ENDSegment();

Description

AR_ENDSegment does all of the final calculation and debug log printing at the end of your while loop. It should be the very last thing in your loop

Usage

AR_ENDSegment();
}

Getting your data

If everything is set up properly, you should be able to drive your robot with your joystick plugged into the computer via the wireless downloader, and the code should appear in the debug stream

Other requirements

Items