BO.io.GyroITG3200 Class
Creates an interface to an ITG3200 3-axis gyroscope. This gyro measures angular acceleration around the x, y, and z axis. This object provides the angular velocity of each axis. Proper calibration is required for an accurate reading. See Breakout/examples/sensors/itg3200.html and Breakout/examples/processing_js/gyro.html for example applications.
Constructor
BO.io.GyroITG3200
-
board -
autoStart -
address
Parameters:
-
boardIOBoardThe IOBoard instance
-
autoStartBooleanTrue if read continuous mode should start automatically upon instantiation (default is true)
-
addressNumberThe i2c address of the accelerometer. If pin 9 (AD0) of the module is tied to VDD, then use
GyroITG3200.ID_AD0_DVV(0x69), if pin 9 (AD0) is tied to GND, then useGyroITG3200.ID_AD0_GND. Default =GyroITG3200.ID_AD0_VDD
Item Index
Methods
Properties
- address
- GyroITG3200.ID_AD0_VDD static
- GyroITG3200.ID_AD0_VDD static
- I2CBase.I2C_REPLY
- isRunning
- rawX
- rawY
- rawZ
- x
- y
- z
Events
Methods
addEventListener
-
type -
listener
Parameters:
-
typeStringThe event type
-
listenerFunctionThe function to be called when the event is fired
dispatchEvent
-
type -
optionalParams
Parameters:
-
typeEventThe Event object.
-
optionalParamsObjectOptional parameters passed as an object. return {boolean} True if dispatch is successful, false if not.
handleI2C
()
private
hasEventListener
-
type
Parameters:
-
typeStringThe event type return {boolean} True is listener exists for this type, false if not.
init
()
private
onGyroReady
()
private
readGyro
()
private
removeEventListener
-
type -
listener
Parameters:
-
typeStringThe event type
-
listenerFunctionThe function to be called when the event is fired
sendI2CRequest
-
command -
data
Send an i2c request command to the board
Parameters:
-
commandNumber -
dataNumber
setGains
-
xGain -
yGain -
zGain
Set the gain value for the x, y, or z output.
Parameters:
-
xGainNumber -
yGainNumber -
zGainNumber
setOffsets
-
xOffset -
yOffset -
zOffset
Offset the x, y, or z output by the respective input value.
Parameters:
-
xOffsetNumber -
yOffsetNumber -
zOffsetNumber
setRegisterBit
()
private
setRevPolarity
-
xPol -
yPol -
zPol
Set the polarity of the x, y, and z output values.
Parameters:
-
xPolBooleanPolarity of the x axis
-
yPolBooleanPolarity of the y axis
-
zPolBooleanPolarity of the z axis
startReading
()
Start continuous reading of the sensor.
stopReading
()
Stop continuous reading of the sensor.
update
()
Sends read request to accelerometer and updates accelerometer values.
Properties
address
Number
[read-only] The address of the i2c device.
GyroITG3200.ID_AD0_VDD
Unknown
static
ID = 0x69 if sensor pin 9 (AD0) is tied to Power.
GyroITG3200.ID_AD0_VDD
Unknown
static
ID = 0x68 if sensor pin 9 (AD0) is tied to Ground.
I2CBase.I2C_REPLY
Unknown
isRunning
Boolean
[read-only] The state of continuous read mode. True if continuous read mode is enabled, false if it is disabled.
rawX
Number
[read-only] The raw value of the x axis
rawY
Number
[read-only] The raw value of the y axis
rawZ
Number
[read-only] The raw value of the z axis
x
Number
[read-only] The x axis output value in degrees.
y
Number
[read-only] The y axis output value in degrees.
z
Number
[read-only] The z axis output value in degrees.
Events
update
BO.io.GyroEvent.UPDATE
The update event is dispatched when the accelerometer values are updated.
Event Payload:
-
targetBO.io.GyroITG3200A reference to the GyroITG3200 object.
