how much equipment needed for robot arm control?

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

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.

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

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?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

You would only see the error message if you open the serial monitor (icon on the far right of the tool bar).

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

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?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

Post a photo showing all of your connections and we will take a look.

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

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
I'll try again in the daylight
gyro_night.png (250.71 KiB) Viewed 3003 times
I'll try again in the daylight
I'll try again in the daylight
gyro_night.png (250.71 KiB) Viewed 3003 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
trying another
gyro_night3.png (190.56 KiB) Viewed 3002 times
Attachments
can see gyro to mega with four wires again I'll try again in daylight
can see gyro to mega with four wires again I'll try again in daylight
gyro_night2.png (179.59 KiB) Viewed 3003 times

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

Can't really see much in the photos. Try again maybe when the sun comes up.

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

What exactly are you looking for?
outside disconnected from usb
outside disconnected from usb
gyro_day1.png (389.42 KiB) Viewed 2965 times
I am taking scrn captures from the cheap pocket camcorder and the stills are blurry
scl and sda on mega from gyro
scl and sda on mega from gyro
gyro_day2.png (317.62 KiB) Viewed 2965 times
I'll try again from a different angle
gnd and 5 v on mega from gyro
gnd and 5 v on mega from gyro
gyro_day3.png (206.74 KiB) Viewed 2965 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 2:05 pm, edited 1 time in total.

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

continuing from previous msg
trying to add more than 3 pictures to previous msg
different angle gyro and mega
different angle gyro and mega
gyro_day4.png (378.65 KiB) Viewed 2960 times
different angle in sun
different angle gnd and 5V next to each other on mega<br />white wire on 5v mega and vcc gyro
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 2960 times
scl and sda
SCL and SDA
SCL and SDA
gyro_day6.png (229.73 KiB) Viewed 2960 times

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

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?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

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: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

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

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

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

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: how much equipment needed for robot arm control?

Post by adafruit_support_bill »

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

Code: Select all

#include <Wire.h> 
#include <Adafruit_L3GD20.h>

Adafruit_L3GD20 gyro;  // Use the default constructor for I2C

void setup() 
{

...

kgraf
 
Posts: 38
Joined: Fri Nov 16, 2012 4:27 pm

Re: how much equipment needed for robot arm control?

Post by kgraf »

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?

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”