User Manual
Returns 1 if the device is in the USB Suspend State. If the device is connected to a computer, this usually
indicates that the computer has gone to sleep, but on some computers the Suspend State occurs several
times whenever the device is plugged in.
static unsigned char OrangutanSVP::dtrEnabled()
unsigned char dtr_enabled()
Returns either 0 or 1, indicating the value of the DTR virtual handshaking line on the Pololu Orangutan
SVP USB Communications Port. This line is controlled by the computer’s virtual serial port driver
and terminal software. This line corresponds to the DtrEnable member of the .NET
System.IO.Ports.SerialPort class. This line defaults to 0. Several standard terminal programs set this
line to 1 when they connect to a serial port, and then set it to 0 when they disconnect. Therefore this
command can be used to determine whether a terminal program is connected to the Orangutan, and make
the Orangutan’s behavior dependent on that.
static unsigned char OrangutanSVP::rtsEnabled()
unsigned char rts_enabled()
Returns either 0 or 1, indicating the value of the RTS virtual handshaking line on the Pololu Orangutan
SVP USB Communications Port. This line is controlled by the computer’s virtual serial port driver
and terminal software. This line corresponds to the RtsEnable member of the .NET
System.IO.Ports.SerialPort class. This line defaults to 0.
static int OrangutanSVP::getCountsAB()
static int OrangutanSVP::getCountsCD()
int svp_get_counts_ab()
int svp_get_counts_cd()
Returns the number of counts measured on encoder AB or CD. For the Pololu wheel encoders, the
resolution is about 3 mm/count, so this allows a maximum distance of 32767 × 3 mm or about 100 m.
For longer distances, you will need to occasionally reset the counts using the functions below. The counts
will be increase if A/C changes before B/D, and decrease if B/D changes before A/C.
static int OrangutanSVP::getCountsAndResetAB()
static int OrangutanSVP::getCountsAndResetCD()
int svp_get_counts_and_reset_ab()
int svp_get_counts_and_reset_cd()
Returns the number of counts measured on encoder AB or CD, and resets the stored value to zero.
static int OrangutanSVP::checkErrorAB()
static int OrangutanSVP::checkErrorCD()
int svp_check_error_ab()
int svp_check_error_cd()
These commands check whether there has been an error on AB or CD; that is, if both A/B or C/D changed
simultaneously. They return 1 if there was an error, then reset the error flag to zero.
static unsigned char OrangutanSVP::getFirmwareVersion()
unsigned char svp_get_firmware_version()
This command asks the Orangutan SVP’s auxiliary processor what version of its firmware is running.
The return value of this function for all Orangutans released so far should be 1. This command can be
useful for testing or debugging the SPI connection to the auxiliary processor.
Pololu AVR Library Command Reference © 2001–2015 Pololu Corporation
13. Orangutan SVP Functions Page 50 of 65