Eric Wu / Mbed 2 deprecated WifiRobot

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

irobotActuator.h File Reference

irobotActuator.h File Reference

iRobot Create actuator functions. More...

Go to the source code of this file.

Functions

int32_t irobotDigitalOutputs (const irobotUARTPort_t port, const uint8_t output)
 Write to the digital output bank of the cargo bay on iRobot.
int32_t irobotDriveDirect (const irobotUARTPort_t port, int16_t leftWheelSpeed, int16_t rightWheelSpeed)
 Directly actuate left and right wheels.
int32_t irobotDriveDirection (const irobotUARTPort_t port, int16_t velocity, const irobotDirection_t direction)
 Drives in a fixed direction.
int32_t irobotDriveRadius (const irobotUARTPort_t port, int16_t velocity, int16_t radius)
 Drive the robot with a fixed linear speed, and turning through a fixed radius.
int32_t irobotLEDs (const irobotUARTPort_t port, const irobotLED_t leds, const uint8_t powerColor, const uint8_t powerIntensity)
 Change the state of the iRobot power, play, and advance LEDs.
int32_t irobotPWMLowSideDrivers (const irobotUARTPort_t port, uint8_t pwm0, uint8_t pwm1, uint8_t pwm2)
 Set the PWM duty cycle of the low-side drivers.
int32_t irobotSong (const irobotUARTPort_t port, uint8_t songNumber, const irobotSongNote_t *const songNotes, uint8_t nNotes)
 Define a song.
int32_t irobotPlaySong (const irobotUARTPort_t port, const uint8_t songNumber)
 Play a song.
int32_t irobotStop (const irobotUARTPort_t port)
 Stops the wheels.

Detailed Description

iRobot Create actuator functions.

Author:
Jeff C. Jensen
Date:
2013-10-17 Copyright (C) 2013, Jeff C. Jensen, Edward A. Lee, and Sanjit A. Seshia. This software accompanies An Introductory Lab in Embedded and Cyber-Physical Systems and is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. See http://leeseshia.org/lab.

Definition in file irobotActuator.h.


Function Documentation

int32_t irobotDigitalOutputs ( const irobotUARTPort_t  port,
const uint8_t  output 
)

Write to the digital output bank of the cargo bay on iRobot.

Returns:
error code
Parameters:
[in]portUART port
[in]outputPins 0-7

Definition at line 14 of file irobotActuator.cpp.

int32_t irobotDriveDirect ( const irobotUARTPort_t  port,
int16_t  leftWheelSpeed,
int16_t  rightWheelSpeed 
)

Directly actuate left and right wheels.

Returns:
error code
Parameters:
[in]portUART port
[in]leftWheelSpeedLeft wheels speed, in mm/s
[in]rightWheelSpeedRight wheel speed, in mm/s

Definition at line 26 of file irobotActuator.cpp.

int32_t irobotDriveDirection ( const irobotUARTPort_t  port,
int16_t  velocity,
const irobotDirection_t  direction 
)

Drives in a fixed direction.

Returns:
error code
Parameters:
[in]portUART port
[in]velocityVelocity, in mm/s
[in]directiondirection

Definition at line 45 of file irobotActuator.cpp.

int32_t irobotDriveRadius ( const irobotUARTPort_t  port,
int16_t  velocity,
int16_t  radius 
)

Drive the robot with a fixed linear speed, and turning through a fixed radius.

Warning:
Do not call this function for the special cases of driving straight, or clockwise and counter-clockwise turning; this function instructs the robot to drive only nonzero radii.
Returns:
error code
Parameters:
[in]portUART port
[in]velocityVelocity, in mm/s
[in]radiusRadius, in mm

Definition at line 63 of file irobotActuator.cpp.

int32_t irobotLEDs ( const irobotUARTPort_t  port,
const irobotLED_t  leds,
const uint8_t  powerColor,
const uint8_t  powerIntensity 
)

Change the state of the iRobot power, play, and advance LEDs.

Returns:
error code
Parameters:
[in]portUART port
[in]ledsLEDs to turn on
[in]powerColorPower LED color (G[0] - R[255])
[in]powerIntensityPower LED intensiy (0-255)

Definition at line 89 of file irobotActuator.cpp.

int32_t irobotPlaySong ( const irobotUARTPort_t  port,
const uint8_t  songNumber 
)

Play a song.

Returns:
error code
Parameters:
[in]portUART port
[in]songNumberSong number

Definition at line 156 of file irobotActuator.cpp.

int32_t irobotPWMLowSideDrivers ( const irobotUARTPort_t  port,
uint8_t  pwm0,
uint8_t  pwm1,
uint8_t  pwm2 
)

Set the PWM duty cycle of the low-side drivers.

Returns:
error code
Parameters:
[in]portUART port
[in]pwm0PWM for low-side driver 0 (0-128 duty cycle)
[in]pwm1PWM for low-side driver 1 (0-128 duty cycle)
[in]pwm2PWM for low-side driver 2 (0-128 duty cycle)

Definition at line 105 of file irobotActuator.cpp.

int32_t irobotSong ( const irobotUARTPort_t  port,
uint8_t  songNumber,
const irobotSongNote_t *const   songNotes,
uint8_t  nNotes 
)

Define a song.

Each song is alloted 16 notes, but a song can "spill over" into the next if so desired. The maximum number of notes that may be defined is (16 - SongNumber) * 16.

Returns:
error code
Parameters:
[in]portUART port
[in]songNumberSong number
[in]songNotesSong notes
[in]nNotesNumber of song notes

Definition at line 128 of file irobotActuator.cpp.

int32_t irobotStop ( const irobotUARTPort_t  port )

Stops the wheels.

Returns:
error code
Parameters:
[in]portUART port

Definition at line 168 of file irobotActuator.cpp.