I am having a heck of a time trying to get my L3GD20h to display any raw data. I am pretty sure it is wired correctly, but my code isn't working, and I have the library installed. I tried to keep it as simple as possible.
If anyone knows why or has any information that might be relevant, I would appreciate it.
PS, if this is in the wrong subforum, someone please move me.
#include <Wire.h>
#include <Adafruit_L3GD20.h>
// Comment this next line to use SPI
#define USE_I2C
// The default constructor uses I2C
Adafruit_L3GD20 gyro;
void setup()
{
Serial.begin(9600);
}
void loop()
{
gyro.read();
Serial.print("X: "); Serial.print((int)gyro.data.x); Serial.print(" ");
Serial.print("Y: "); Serial.print((int)gyro.data.y); Serial.print(" ");
Serial.print("Z: "); Serial.println((int)gyro.data.z); Serial.print(" ");
}
I am having a heck of a time trying to get my L3GD20h to display any raw data.
I've never had any luck getting a gyroscope to display any data, either.
I am pretty sure it is wired correctly
So sure, in fact, that you didn't think it necessary to include a schematic. Well, I'm equally certain that it is NOT wired correctly. If it was, you'd be getting some kind of data, reasonable or not, from it.
PaulS:
I've never had any luck getting a gyroscope to display any data, either.
So sure, in fact, that you didn't think it necessary to include a schematic. Well, I'm equally certain that it is NOT wired correctly. If it was, you'd be getting some kind of data, reasonable or not, from it.
SCL is connected to A5
SDA is connected to A4
GND is to GND
Vin is to 3.3V
Check your soldering. Make sure that there are no bridges or poor joints. Make certain that the wiring matches the picture. Try another I2C device, such as an RTC, to make sure that the pins are good (undamaged).
PaulS:
Check your soldering. Make sure that there are no bridges or poor joints. Make certain that the wiring matches the picture. Try another I2C device, such as an RTC, to make sure that the pins are good (undamaged).
I don't think I have another RTC device, and it's not soddered, I am just using jumpers right now.
The wires going to the Arduino are fine. The gyro board appears to have headers soldered on. It's hard to tell if the header pins extend below the gyro board, into the breadboard. If not, then you are not actually connecting power and ground to the gyro board. If they do, then everything is soldered, assuming that the headers are not just pushed through the holes in the gyro board.
PaulS:
The wires going to the Arduino are fine. The gyro board appears to have headers soldered on. It's hard to tell if the header pins extend below the gyro board, into the breadboard. If not, then you are not actually connecting power and ground to the gyro board. If they do, then everything is soldered, assuming that the headers are not just pushed through the holes in the gyro board.
Yes, they do go below into the bread board, but just to be sure I will take it off and just use the jumpers.
PaulS:
Why speak really slowly when your listener can understand speech at normal speeds?
It would be a poor data sheet that did not include the address.
Ah, is there another place I need to also set the communication speed?