WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

Sanyo/LB1836M.h

The LB1836M is a rather light weight motor driver and is included on 'old' BabyOrangutan boards.
The device can support two DC motors. Each motor requires two PWM channels and is therefore quite 'hungry' on timers.
Here is an example of how it can be used:
// Define the motors
SANYO_LB1836M_MOTOR Motor1 = MAKE_SANYO_LB1836M_MOTOR(FALSE, B1, D5);
SANYO_LB1836M_MOTOR Motor2 = MAKE_SANYO_LB1836M_MOTOR(FALSE, B2, D6);
SANYO_LB1836M_MOTOR_LIST PROGMEM onboard_motors[] = {&Motor1, &Motor2};
SANYO_LB1836M_MOTOR_DRIVER onboard_driver = MAKE_SANYO_LB1836M_MOTOR_DRIVER(onboard_motors);
Inside 'appInitHardware':-
// Initialise the driver to use a PWM frequency of 5kHz
sanyoLB1836M_Init(&onboard_driver, 5000);
Note that if you are using the BabyOrangutan then this has already done for you as it is built onto the board. Refer to the relevant 'sys' file for your BabyOrangutan board.

Valid XHTML 1.0 Transitional