#include "SHDefines.h"
#include "NXShieldI2C.h"
Go to the source code of this file.
|
#define | SH_CONTROL_SPEED 0x01 |
|
#define | SH_CONTROL_RAMP 0x02 |
|
#define | SH_CONTROL_RELATIVE 0x04 |
|
#define | SH_CONTROL_TACHO 0x08 |
|
#define | SH_CONTROL_BRK 0x10 |
|
#define | SH_CONTROL_ON 0x20 |
|
#define | SH_CONTROL_TIME 0x40 |
|
#define | SH_CONTROL_GO 0x80 |
|
#define | SH_STATUS_SPEED 0x01 |
|
#define | SH_STATUS_RAMP 0x02 |
|
#define | SH_STATUS_MOVING 0x04 |
|
#define | SH_STATUS_TACHO 0x08 |
|
#define | SH_STATUS_BREAK 0x10 |
|
#define | SH_STATUS_OVERLOAD 0x20 |
|
#define | SH_STATUS_TIME 0x40 |
|
#define | SH_STATUS_STALL 0x80 |
|
#define | SH_COMMAND 0x41 |
|
#define | SH_VOLTAGE 0x41 |
|
#define | SH_SETPT_M1 0x42 |
|
#define | SH_SPEED_M1 0x46 |
|
#define | SH_TIME_M1 0x47 |
|
#define | SH_CMD_B_M1 0x48 |
|
#define | SH_CMD_A_M1 0x49 |
|
#define | SH_SETPT_M2 0x4A |
|
#define | SH_SPEED_M2 0x4E |
|
#define | SH_TIME_M2 0x4F |
|
#define | SH_CMD_B_M2 0x50 |
|
#define | SH_CMD_A_M2 0x51 |
|
#define | SH_POSITION_M1 0x62 |
|
#define | SH_POSITION_M2 0x66 |
|
#define | SH_STATUS_M1 0x72 |
|
#define | SH_STATUS_M2 0x73 |
|
#define | SH_TASKS_M1 0x76 |
|
#define | SH_TASKS_M2 0x77 |
|
#define | SH_ENCODER_PID 0x7A |
|
#define | SH_SPEED_PID 0x80 |
|
#define | SH_PASS_COUNT 0x86 |
|
#define | SH_TOLERANCE 0x87 |
|
#define | SH_Speed_Full 90 |
|
#define | SH_Speed_Medium 60 |
|
#define | SH_Speed_Slow 25 |
|
#define | SH_Bank_A 0x06 |
|
#define | SH_Bank_B 0x08 |
|
#define | SH_Type_ANALOG_PASSIVE 0x01 |
|
#define | SH_Type_ANALOG_9VOLTS 0x02 |
|
#define | SH_Type_ANALOG_ACTIVE 0x02 |
|
#define | SH_Type_I2C 0x04 |
|
#define | SH_Type_ANALOG 0x08 |
|
#define | SH_Type_MIXED 0x10 |
|
#define | SH_Type_DATABIT0_HIGH 0x40 |
|
#define | SH_Type_DATABIT1_HIGH 0x80 |
|
#define | SH_S1 1 |
|
#define | SH_S2 2 |
|
NXShield.h defines main interfaces used in the NXShield library.
This is used internally to address Sensor Port 1. Do not use this in sketches. Sketches should use SH_BankPort enums.
This is used internally to address Sensor Port 2. Do not use this in sketches. Sketches should use SH_BankPort enums.
#define SH_Type_ANALOG 0x08 |
In this type the sensor port is not powered (for sensors like touch sensor).
#define SH_Type_ANALOG_9VOLTS 0x02 |
In this type 9 volt power is supplied to sensor.
#define SH_Type_ANALOG_ACTIVE 0x02 |
Useed for Active sensors, in which pulsed power (9 volts) is supplied to sensor.
#define SH_Type_ANALOG_PASSIVE 0x01 |
In this type the sensor port is not powered (for sensors like touch sensor).
#define SH_Type_DATABIT0_HIGH 0x40 |
in this type: light sensor - light is turned on, sumoeyes changes range, and sound sensor changes range (db to linear)
#define SH_Type_DATABIT1_HIGH 0x80 |
required for sound sensor to change range (db to linear)
In this type the sensor connected should be an i2c device.
#define SH_Type_MIXED 0x10 |
this type is theoratical. (possibly for SumoEyes)
Enumerator |
---|
SH_Completion_Dont_Wait |
Don't wait for motor to finish, program will continue with next function
|
SH_Completion_Wait_For |
Wait for motor to finish, program will wait until current function finishes it's operation
|
Motor direction related constants.
Enumerator |
---|
SH_Direction_Reverse |
Run motor in reverse direction
|
SH_Direction_Forward |
Run motor in forward direction
|
Motor selection related constants
Enumerator |
---|
SH_Motor_1 |
Choose Motor 1 for selected operation
|
SH_Motor_2 |
Choose Motor 2 for selected operation
|
SH_Motor_Both |
Choose Both Motors for selected operation
|
Enumerator |
---|
SH_Move_Absolute |
Move the tach to absolute value provided
|
SH_Move_Relative |
Move the tach relative to previous position
|
Enumerator |
---|
SH_Next_Action_Float |
stop and let the motor coast.
|
SH_Next_Action_Brake |
apply brakes, and resist change to tachometer, but if tach position is forcibly changed, do not restore position
|
SH_Next_Action_BrakeHold |
apply brakes, and restore externally forced change to tachometer
|
bool format_bin |
( |
uint8_t |
i, |
|
|
char * |
s |
|
) |
| |
This function formats an integer in binary format.
- Parameters
-
i | 8 bit integer value |
s | returned string of the binary representation |