Mindstorms 3rd Party ROBOTC Drivers RobotC
[Home] [Download] [Submit a bug/suggestion] [ROBOTC Forums] [Blog] [Support this project]
Defines | Functions | Variables

mindensors-servo.h File Reference

Mindsensors NXTServo Sensor Driver. More...

#include "common.h"

Go to the source code of this file.

Defines

#define NXTSERVO_I2C_ADDR   0xB0
#define NXTSERVO_CMD   0x41
#define NXTSERVO_POS_CHAN1   0x42
#define NXTSERVO_POS_CHAN2   0x44
#define NXTSERVO_POS_CHAN3   0x46
#define NXTSERVO_POS_CHAN4   0x48
#define NXTSERVO_POS_CHAN5   0x4A
#define NXTSERVO_POS_CHAN6   0x4C
#define NXTSERVO_POS_CHAN7   0x4E
#define NXTSERVO_POS_CHAN8   0x50
#define NXTSERVO_SPEED_CHAN1   0x52
#define NXTSERVO_SPEED_CHAN2   0x53
#define NXTSERVO_SPEED_CHAN3   0x54
#define NXTSERVO_SPEED_CHAN4   0x55
#define NXTSERVO_SPEED_CHAN5   0x56
#define NXTSERVO_SPEED_CHAN6   0x57
#define NXTSERVO_SPEED_CHAN7   0x58
#define NXTSERVO_SPEED_CHAN8   0x59
#define NXTSERVO_QPOS_CHAN1   0x42
#define NXTSERVO_QPOS_CHAN2   0x44
#define NXTSERVO_QPOS_CHAN3   0x46
#define NXTSERVO_QPOS_CHAN4   0x48
#define NXTSERVO_QPOS_CHAN5   0x4A
#define NXTSERVO_QPOS_CHAN6   0x4C
#define NXTSERVO_QPOS_CHAN7   0x4E
#define NXTSERVO_QPOS_CHAN8   0x50
#define NXTSERVO_MIN_POS   500
#define NXTSERVO_MAX_POS   2500
#define NXTSERVO_MID_POS   1500

Functions

bool NXTServoSetSpeed (tSensors link, ubyte servochan, ubyte speed, ubyte address)
bool NXTServoSetPos (tSensors link, ubyte servochan, int position, ubyte speed, ubyte address=NXTSERVO_I2C_ADDR)
bool NXTServoQSetPos (tSensors link, ubyte servochan, ubyte position, byte speed, ubyte address=NXTSERVO_I2C_ADDR)
int NXTServoReadVoltage (tSensors link, ubyte address=NXTSERVO_I2C_ADDR)

Variables

tByteArray NXTSERVO_I2CRequest
tByteArray NXTSERVO_I2CReply

Detailed Description

Mindsensors NXTServo Sensor Driver.

mindensors-servo.h provides an API for the Mindsensors NXTServo Sensor

Changelog:

Credits:

License: You may use this code as you wish, provided you give credit where its due.

THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.59 AND HIGHER.

Author:
Xander Soldaat (xander_at_botbench.com)
Date:
30 September 2009
Version:
0.1

Definition in file mindensors-servo.h.