-
-
Save GiovanniBalestrieri/3736318e069bc4487f88 to your computer and use it in GitHub Desktop.
Getting angular rate value from L3G4200D gyroscope and Arduino
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void getGyroValues() | |
{ | |
timerReading = micros() - dt; | |
byte xMSB = readRegister(L3G4200D_Address, 0x29); | |
byte xLSB = readRegister(L3G4200D_Address, 0x28); | |
x = ((xMSB << 8) | xLSB); | |
byte yMSB = readRegister(L3G4200D_Address, 0x2B); | |
byte yLSB = readRegister(L3G4200D_Address, 0x2A); | |
y = ((yMSB << 8) | yLSB); | |
byte zMSB = readRegister(L3G4200D_Address, 0x2D); | |
byte zLSB = readRegister(L3G4200D_Address, 0x2C); | |
z = ((zMSB << 8) | zLSB); | |
dt = micros(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment