The new Raspberry Pi B Model B+ is here - Pick one up in the store and check our detailed guide!

Re: how much equipment needed for robot arm control?

by adafruit_support_bill on Thu Dec 20, 2012 6:24 am

OK. Let's first go back and get your libraries installed properly.
I added Adafruit_L3GD20.h and Adafruit_L3GD20.cpp to the Wire folder under Libraries and it compiled and uploaded and then does nothing


Once you have it installed:
    Shut down ALL instances of the IDE, then open one up again.
    Click on File->Examples->Adafruit_L3GD20->Adafruit_L3GD20_test
    Then try to upload.
User avatar
adafruit_support_bill
 
Posts: 27992
Joined: Sat Feb 07, 2009 9:11 am

Re: how much equipment needed for robot arm control?

by kgraf on Thu Dec 20, 2012 12:42 pm

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?
kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 3:27 pm

Re: how much equipment needed for robot arm control?

by adafruit_support_bill on Thu Dec 20, 2012 4:46 pm

You would only see the error message if you open the serial monitor (icon on the far right of the tool bar).
User avatar
adafruit_support_bill
 
Posts: 27992
Joined: Sat Feb 07, 2009 9:11 am

Re: how much equipment needed for robot arm control?

by kgraf on Thu Dec 20, 2012 7:31 pm

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?
kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 3:27 pm

Re: how much equipment needed for robot arm control?

by adafruit_support_bill on Thu Dec 20, 2012 8:04 pm

Post a photo showing all of your connections and we will take a look.
User avatar
adafruit_support_bill
 
Posts: 27992
Joined: Sat Feb 07, 2009 9:11 am

Re: how much equipment needed for robot arm control?

by kgraf on Fri Dec 21, 2012 12:21 am

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
gyro_night.png
I'll try again in the daylight
gyro_night.png (250.71 KiB) Viewed 2496 times
gyro_night.png
I'll try again in the daylight
gyro_night.png (250.71 KiB) Viewed 2496 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
gyro_night3.png
trying another
gyro_night3.png (190.56 KiB) Viewed 2495 times
Attachments
gyro_night2.png
can see gyro to mega with four wires again I'll try again in daylight
gyro_night2.png (179.59 KiB) Viewed 2496 times
kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 3:27 pm

Re: how much equipment needed for robot arm control?

by adafruit_support_bill on Fri Dec 21, 2012 5:49 am

Can't really see much in the photos. Try again maybe when the sun comes up.
User avatar
adafruit_support_bill
 
Posts: 27992
Joined: Sat Feb 07, 2009 9:11 am

Re: how much equipment needed for robot arm control?

by kgraf on Fri Dec 21, 2012 11:57 am

What exactly are you looking for?
gyro_day1.png
outside disconnected from usb
gyro_day1.png (389.42 KiB) Viewed 2458 times

I am taking scrn captures from the cheap pocket camcorder and the stills are blurry
gyro_day2.png
scl and sda on mega from gyro
gyro_day2.png (317.62 KiB) Viewed 2458 times

I'll try again from a different angle
gyro_day3.png
gnd and 5 v on mega from gyro
gyro_day3.png (206.74 KiB) Viewed 2458 times

still blurry
next post has slightly better pictures
and there is a 3 photo limit per post
Last edited by kgraf on Fri Dec 21, 2012 1:05 pm, edited 1 time in total.
kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 3:27 pm

Re: how much equipment needed for robot arm control?

by kgraf on Fri Dec 21, 2012 1:01 pm

continuing from previous msg
trying to add more than 3 pictures to previous msg
gyro_day4.png
different angle gyro and mega
gyro_day4.png (378.65 KiB) Viewed 2453 times

different angle in sun
gyro_day5.png
different angle gnd and 5V next to each other on mega
white wire on 5v mega and vcc gyro
gyro_day5.png (382.78 KiB) Viewed 2453 times

scl and sda
gyro_day6.png
SCL and SDA
gyro_day6.png (229.73 KiB) Viewed 2453 times
kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 3:27 pm

Re: how much equipment needed for robot arm control?

by kgraf on Mon Dec 24, 2012 3:34 pm

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?
kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 3:27 pm

Re: how much equipment needed for robot arm control?

by adafruit_support_bill on Wed Jan 02, 2013 1:30 pm

Sorry, your post got buried in the holiday rush.

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.
User avatar
adafruit_support_bill
 
Posts: 27992
Joined: Sat Feb 07, 2009 9:11 am

Re: how much equipment needed for robot arm control?

by adafruit_support_bill on Wed Jan 02, 2013 6:17 pm

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
User avatar
adafruit_support_bill
 
Posts: 27992
Joined: Sat Feb 07, 2009 9:11 am

Re: how much equipment needed for robot arm control?

by kgraf on Mon Jan 07, 2013 12:43 am

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);
}
}

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(" ");
delay(100);
}
kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 3:27 pm

Re: how much equipment needed for robot arm control?

by adafruit_support_bill on Mon Jan 07, 2013 5:38 am

1. yes. You can comment out or delete the SPI pin definitions.
2. Call the constructor at the beginning before setup.

Code: Select all | TOGGLE FULL SIZE
#include <Wire.h>
#include <Adafruit_L3GD20.h>

Adafruit_L3GD20 gyro;  // Use the default constructor for I2C

void setup()
{

...
User avatar
adafruit_support_bill
 
Posts: 27992
Joined: Sat Feb 07, 2009 9:11 am

Re: how much equipment needed for robot arm control?

by kgraf on Tue Jan 08, 2013 7:45 pm

success.
it prints data on x y z continuously

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?
kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 3:27 pm