IAR Hardware
Please note that the IAR hardware is not yet fully integrated with the DevBot hardware abstraction architecture. Where devices are not integrated with the hardware abstraction layer, they can be accessed via driver internal functions as described in Accessing a non-standard sensor.Contents
Motors
The motors can be accessed using the standard motor interface i.e.
bot_servomotor_set_velocity(motor1, IPAB_SREV) bot_servomotor_get_velocity(motor1)
The velocity constants are defined in ipab_ioboard.h as follows:
#define IPAB_FFWD 0 /* fast forward */ #define IPAB_SFWD 1 /* slow forward - only for motor 1, 2 */ #define IPAB_STOP 2 #define IPAB_FREV 3 /* fast reverse */ #define IPAB_SREV 4 /* slow reverse - only for motor 1, 2 */
Hall effect and bumpers
The Hall effect and bumper sensors are accessed through the standard "switch" interface ie.
bot_switch_get_value(switch_device) bot_switch_get_value(halleffect_device)
Infra-red and light sensors
The infra-red and light sensors are accessed through the standard "raw" interface ie.
bot_raw_get_value(ir1_device) bot_raw_get_value(ldr1_device)
Compass
The compass is accessed through an internal function of the ipab_compass driver.
ipab_get_compass(compass_device)
LEDs
The LEDs are accessed via internal functions of the ipab_leds driver.
ipab_get_leds(leds_device) ipab_set_leds(leds_device, command_constants, led_constants)
The LED constants are defined in ipab_ioboard.h.
The commands are as follows:
#define IPAB_OFF 0 #define IPAB_ON 1 #define IPAB_TOGGLE 2 #define IPAB_ALLOFF 3 #define IPAB_ALLON 4
The individual LEDs can be referred to using the following constants:
#define LED1 0x01 #define LED2 0x02 #define LED3 0x04 #define LED4 0x08 #define LED5 0x10 #define LED6 0x20 #define LED7 0x40 #define LED8 0x80
Sample configuration file
For reference, here is a standard configuration file
[ioboard] Driver=ipab_ioboard [leds] Driver=ipab_leds InterfaceBoard=ioboard [motor1] Driver=ipab_motors InterfaceBoard=ioboard Index=0 [motor2] Driver=ipab_motors InterfaceBoard=ioboard Index=1 [motor3] Driver=ipab_motors InterfaceBoard=ioboard Index=2 [motor4] Driver=ipab_motors InterfaceBoard=ioboard Index=3 [switch1] Driver=ipab_switches InterfaceBoard=ioboard Index=0 [switch2] Driver=ipab_switches InterfaceBoard=ioboard Index=1 [switch3] Driver=ipab_switches InterfaceBoard=ioboard Index=2 [switch4] Driver=ipab_switches InterfaceBoard=ioboard Index=3 [switch5] Driver=ipab_switches InterfaceBoard=ioboard Index=4 [switch6] Driver=ipab_switches InterfaceBoard=ioboard Index=5 [halleffect] Driver=ipab_halleffect InterfaceBoard=ioboard [ldr1] Driver=ipab_light InterfaceBoard=ioboard Index=0 [ldr2] Driver=ipab_light InterfaceBoard=ioboard Index=1 [ldr3] Driver=ipab_light InterfaceBoard=ioboard Index=2 [ldr4] Driver=ipab_light InterfaceBoard=ioboard Index=3 [ir1] Driver=ipab_infrared InterfaceBoard=ioboard Index=0 [ir2] Driver=ipab_infrared InterfaceBoard=ioboard Index=1 [compass] Driver=ipab_compass InterfaceBoard=ioboard
(c) 2006 Edinburgh Robotics Ltd.
Generated on Fri Feb 2 11:24:07 2007 for libbot by doxygen 1.5.1