Download Print this page
Parallax 27911 Manual

Parallax 27911 Manual

Gyroscope module kickstart

Advertisement

Quick Links

Parallax Gyroscope Module KickStart (#27911)
What It Can Do
Modular angular rate sensor tracks motion in three axes
Three selectable measurement scales, with rates up to 2000° per second
Built-in temperature sensor; can be used separately, or for temperature drift compensation
The 3-Axis Gyroscope module provides separate data values for yaw, pitch, and roll. Motion is
indicated as a positive or negative value, depending on the direction of rotation. The sensor is
useful in 3D simulation, virtual gaming input devices, robotics, and for remotely controlled or
unpiloted aircraft and submersibles.
Gyroscopes are commonly used with multi-axis accelerometers, where the data from both
sensors can provide useful information detailing speed and direction of travel. The Memsic 2125
Dual-axis Accelerometer and MMA7455 3-Axis Accelerometer Module are good companion
accelerometers for the 3-Axis Gyroscope module
It may also be used with an accelerometer and 3-axis compass to construct a 9-axis IMU (inertial
measurement unit), common in unmanned aerial vehicles, such as drones and quadcopters.
Copyright © Parallax Inc.
Web Site: www.parallax.com
Forums: forums.parallax.com
Sales: sales@parallax.com
Technical: support@parallax.com
Office: (916) 624-8333
Fax: (916) 624-8003
Sales: (888) 512-1024
Tech Support: (888) 997-8267
Page 1 of 12

Advertisement

loading

Summary of Contents for Parallax 27911

  • Page 1 Sales: sales@parallax.com Sales: (888) 512-1024 Technical: support@parallax.com Tech Support: (888) 997-8267 Parallax Gyroscope Module KickStart (#27911) What It Can Do Modular angular rate sensor tracks motion in three axes • Three selectable measurement scales, with rates up to 2000° per second •...
  • Page 2: Parts List

    Dimensions: 0.85 X 0.80 in (2.16 X 2.03 cm) • Program KickStarts The KickStart examples display raw data output for each of the three axes. Values are retrieved from the module using the I2C interface. Copyright © Parallax Inc. Page 2 of 12...
  • Page 3 Word ' Variables for I2C communications I2C_DATA Byte I2C_LSB I2C_REG Byte I2C_VAL Byte PAUSE 100 ' Power up delay ' Set up data ready signal I2C_REG = CTRL_REG3 I2C_VAL = $08 Copyright © Parallax Inc. Page 3 of 12...
  • Page 4 PAUSE 250 LOOP Gyro_Get_Raw: GOSUB Wait_For_Data_Ready GOSUB I2C_Start I2C_DATA = WRITE_DATA GOSUB I2C_Write ' Read the data starting I2C_DATA = OUT_X_INC at pointer register GOSUB I2C_Write GOSUB I2C_Stop GOSUB I2C_Start I2C_DATA = READ_DATA Copyright © Parallax Inc. Page 4 of 12...
  • Page 5 I2C_Write_Reg: GOSUB I2C_Start I2C_DATA = WRITE_DATA GOSUB I2C_Write I2C_DATA = I2C_REG GOSUB I2C_Write I2C_DATA = I2C_VAL GOSUB I2C_Write GOSUB I2C_Stop RETURN ' Set I2C_REG before calling this, I2C_DATA will have result I2C_Read_Reg: Copyright © Parallax Inc. Page 5 of 12...
  • Page 6 IF I2C_LSB THEN INPUT SDA ELSE LOW SDA INPUT SCL LOW SCL INPUT SDA INPUT SCL LOW SCL RETURN Note: When this program is run the BASIC Stamp Debug Terminal will automatically open. Copyright © Parallax Inc. Page 6 of 12...
  • Page 7 CTRL_REG2 = $21 CTRL_REG3 = $22 CTRL_REG4 = $23 STATUS_REG = $27 OUT_X_INC = $A8 x_idx = 0 y_idx = 1 z_idx = 2 long x long y long z long cx Copyright © Parallax Inc. Page 7 of 12...
  • Page 8 '' Below here routines to support I2C interfacing PUB WaitForDataReady | status repeat status := Read_1B(STATUS_REG) if (status & $08) == $08 quit PUB Wrt_1B(SUB1, data) ''Write single byte to Gyroscope. Copyright © Parallax Inc. Page 8 of 12...
  • Page 9 := ((!value) >< 8) repeat 8 dira[SDApin] := value dira[SCLpin] := false dira[SCLpin] := true value >>= 1 dira[SDApin] := false dira[SCLpin] := false result := not(ina[SDApin]) dira[SCLpin] := true dira[SDApin] := true PRI receive(aknowledge) Copyright © Parallax Inc. Page 9 of 12...
  • Page 10 := false Note: To view the results of the demonstration, after uploading is complete run the Parallax Serial Terminal from the Run menu, or press F12. Click the Enable button in the Terminal window, then momentarily depress the Reset button on the Propeller QuickStart board to restart the program.
  • Page 11 Serial.print(x / 114); Serial.print(" Raw Y:"); Serial.print(y / 114); Serial.print(" Raw Z:"); Serial.println(z / 114); delay(500); // Short delay between reads void getGyroValues () { byte MSB, LSB; MSB = readI2C(0x29); LSB = readI2C(0x28); Copyright © Parallax Inc. Page 11 of 12...
  • Page 12 More information on gyroscopes and inertial navigation may be found by searching Wikipedia: • Gyroscope. Combine the 3-axis gyroscope with the Parallax MMA7455 3-Axis Accelerometer Module • Compass Module 3-Axis HMC5883L to create a 9-axis inertial momentum unit (IMU) Copyright © Parallax Inc.