Resources » Pololu AVR Library Command Reference »13. Orangutan SVP FunctionsThis section of the library provides commands that are only available on the Orangutan SVP. For a higher level overview of how the library works on the Orangutan SVP, please see Section 6.j of the Pololu AVR C/C++ Library User’s Guide. ReferenceC++ and Arduino methods are shown in red. C functions are shown in green. static void OrangutanSVP::setMode(unsigned char mode) void svp_set_mode(unsigned char mode) This command sets the mode of the Orangutan SVP’s auxiliary processor. The mode parameter determines the functions of the auxiliary lines A, B, C, and D.
Additionally, the mode parameter can be inclusively ored with the keyword SVP_SLAVE_SELECT_ON to enable the SPI slave select feature.
static unsigned char OrangutanSVP::usbPowerPresent() unsigned char usb_power_present() Returns 1 if the voltage on the power line of the USB connector is high. This indicates that the device is plugged in to a computer or USB power supply. Returns 0 otherwise. This function is useful if you want your Orangutan to behave differently when it is plugged in to USB (for example, by not running its motors). static unsigned char OrangutanSVP::usbConfigured() unsigned char usb_configured() Returns 1 if the device has reached the USB Configured State as defined in the USB 2.0 Specification. This indicates that the device is plugged in to a computer and the right drivers might be installed. Returns 0 otherwise. static unsigned char OrangutanSVP::usbSuspend() unsigned char usb_suspend() 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. |
|
Log In
|
Wish Lists
|
BIG Order Form
|
Shopping Cart
US toll free: 1-877-7-POLOLU ~
(702) 262-6648 |
|||||||||||||
| Catalog | Forum | Resources | Distributors | Ordering | About | Contact | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|