I created the Adafruit_L3GD20 folder in the libraries directory, I found the Adafruit_L3GD20_test under file/examples and then tried and nothing, and then tried again and got the error msg about port com3 already in use. I rebooted the computer and directly uploaded Adafruit_L3GD20_test, the rx tx lights flashed, the yellow led above them is now on constantly with the green led and the upload completed with no error msgs and just:
Binary sketch size: 7,932 bytes (of a 258,048 byte maximum)
in the compile/msg window.
That is the good news. I didn't connect anything to the mega other than the usb cable.Shouldn't
I get an error msg from the test program:
{
Serial.println("Oops ... unable to initialize the L3GD20. Check your wiring!");
while (1);
}
about no gyro detected?
Where are the msgs and x,y,z, data values displayed if the program works?
yes that works
Oops ... unable to initialize the L3GD20. Check your wiring!
Oops ... unable to initialize the L3GD20. Check your wiring!
I am now trying to connect the wires
nothing happened and then I tried to upload again
Binary sketch size: 7,932 bytes (of a 258,048 byte maximum)
processing.app.SerialNotFoundException: Serial port 'COM3' not found. Did you select the right one from the Tools > Serial Port menu?
at processing.app.Serial.<init>(Serial.java:191)
at processing.app.Serial.<init>(Serial.java:77)
at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:77)
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:172)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:67)
at processing.app.Sketch.upload(Sketch.java:1706)
at processing.app.Sketch.exportApplet(Sketch.java:1662)
at processing.app.Sketch.exportApplet(Sketch.java:1634)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2346)
at java.lang.Thread.run(Thread.java:619)
I disconnected everything and reconnected everything ran upload and it now gives
Oops ... unable to initialize the L3GD20. Check your wiring!
anytime I press the reset button
I have
gnd to gnd
scl to scl 21
sda to sda 20
vcc to 5v
I don't get any data values only error msg ... unable to initialize the L3GD20. Check your wiring!
is there a way to check if the gyro is working?
can something be sent from the serial monitor send?
trying a nighttime clip from a cheap camcorder and it doesn't show well
I have a row of eight headers soldered directly to the gyro board and the four jumper
wires from scl sda gnd and vcc going out to the mega board that I'll try to get in
another picture
I'll try again in the daylight
gyro_night.png (250.71 KiB) Viewed 3097 times
I'll try again in the daylight
gyro_night.png (250.71 KiB) Viewed 3097 times
you can see the yellow and green leds and the wires without any detail
I'm using header pins and female jumper wires for the connections to the mega
apparently everytime I clicked place inline it placed the photo the multiple times
I didn't intend that
trying another
gyro_night3.png (190.56 KiB) Viewed 3096 times
Attachments
can see gyro to mega with four wires again I'll try again in daylight
I tried a cheap digital camera that gave pictures no better than the scrn captures from the digital camcorder. Can you give a performance/price range for a digital camera that gives decent closeup pictures?
We have had a couple reports of problems with I2C mode on the gyros. Have you tried wiring it for SPI? Despite the comment, the example code with the library is for SPI operation.
There was an update of the library posted yesterday. I will be doing some testing on it later this afternoon.
Update: I tested with the new version of the library and it is working with both SPI and I2C. Be sure to use the right constructor for I2C as described in the new tutorial: http://learn.adafruit.com/adafruit-trip ... t/overview
1. since I am using I2C, I should comment out the defines and Adafruit_L3GD20 gyro(GYRO_CS, GYRO_DO, GYRO_DI, GYRO_CLK); ?
2. where should he constructor call be placed in the code? does the code in Adafruit_L3GD20.h
and/or Adafruit_L3GD20.cpp need to be adjusted?
"To use the L3GD20 in your sketch, you must first call a constructor to create a device object. There are two forms of the constructor:"
Adafruit_L3GD20(void);
//Adafruit_L3GD20_test current code
#include <Wire.h>
#include <Adafruit_L3GD20.h>
// By default, uses I2C
//Adafruit_L3GD20 gyro;
// Alternately, you can use SPI, but you have to define the pins
#define GYRO_CS 4 // labeled CS
#define GYRO_DO 5 // labeled SA0
#define GYRO_DI 6 // labeled SDA
#define GYRO_CLK 7 // labeled SCL
Adafruit_L3GD20 gyro(GYRO_CS, GYRO_DO, GYRO_DI, GYRO_CLK);
void setup()
{
Serial.begin(9600);
// Try to initialise and warn if we couldn't detect the chip
if (!gyro.begin(gyro.L3DS20_RANGE_250DPS))
//if (!gyro.begin(gyro.L3DS20_RANGE_500DPS))
//if (!gyro.begin(gyro.L3DS20_RANGE_2000DPS))
{
Serial.println("Oops ... unable to initialize the L3GD20. Check your wiring!");
while (1);
}
}
1. I turn it off by unplugging the usb - is there a way to program the reset button
to turn off one-button push and restart 2nd button push?
any recommended code sites to learn how to use the data values to drive
robot motors?
2. do you sell a battery pack (9V ?) adapter to drive the mega directly?