Hello and welcome to our community! Is this your first visit?
Register
Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30
  1. #21
    Senior Pilot
    Join Date
    Oct 2012
    Posts
    205
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    5
    Try loading:
    Code:
    void loop(void) 
    {
      if((millis() - timer) > 10) // 100Hz
      {
        Serial.print("timer: ");
        Serial.print((millis()- timer));
        Serial.print(" millis");
        Serial.print(millis());
        timer = millis();
        measureGyro();
      }
    }
    Timer should be 11 and millis will be a large value.

  2. #22
    Senior Pilot
    Join Date
    Oct 2012
    Posts
    205
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    5
    Try this test also:

    Code:
    #include <Wire.h>
    #include <AQMath.h>
    #include <Device_I2C.h>
    //#include <Gyroscope_ITG3200.h>
    #include <GlobalDefined.h>
    #define ITG3200_ADDRESS_ALTERNATE
    #include <Gyroscope_ITG3200_9DOF.h>
    unsigned long timer;
    
    void setup()
    {
      Serial.begin(115200);
      Serial.println("Gyroscope library test (ITG3200)");
    
      Wire.begin();
      Serial.print("ITG3200_IDENTITY");
      Serial.println(ITG3200_IDENTITY);
      Serial.print("GYRO_DETECTED ");
      Serial.println(GYRO_DETECTED);
      Serial.print("ACCEL_DETECTED ");
      Serial.println(ACCEL_DETECTED);
      initializeGyro();
    
      calibrateGyro();
      timer = millis();
    }
    
    void loop(void) 
    {
      if((millis() - timer) > 10) // 100Hz
      {
    //    Serial.print("timer: ");
    //    Serial.print((millis()- timer));
    //    Serial.print(" millis");
    //    Serial.print(millis());
        timer = millis();
        measureGyro(); 
    //    Serial.print(" Roll: ");
    //    Serial.println(degrees(gyroRate[XAXIS]));
    //    Serial.print(" Pitch: ");
    //    Serial.print(degrees(gyroRate[YAXIS]));
    //    Serial.print(" Yaw: ");
    //    Serial.print(degrees(gyroRate[ZAXIS]));
    //    Serial.print(" Heading: ");
    //    Serial.print(degrees(gyroHeading));
    //    Serial.println();
      }
    }
    The above should tell whether or not your shield is reading the AQ_SensorStatus.h file and detecting the gryo in attempt to narrow down which file the problem may be in.

    - - - - - - - - - - The following text was automatically merged with this post to prevent doubleposts - - - - - - - - - -

    You should see below result:
    Code:
    Gyroscope library test (ITG3200)
    ITG3200_IDENTITY104
    GYRO_DETECTED 1
    ACCEL_DETECTED 2

  3. #23
    Senior Pilot wooden's Avatar
    Join Date
    Dec 2011
    Location
    Pacific Northwest
    Posts
    4,866
    Blog Entries
    1
    Downloads
    1
    Uploads
    0
    Reputation Points (Add)
    27
    Why isn't it getting into that if statement... It's as if the millis() function is returning junk.

    Can you put in a print to print out the current value of millis()?
    push the envelope, watch it bend

  4. #24
    Senior Pilot
    Join Date
    Oct 2012
    Posts
    205
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    5
    The ITG3200_ADDRESS_ALTERNATE.h file calls the Gyroscope_ITG3200Common.h file, which defines 0X68 identity address along with other register addresses before it internalizes and measures the gyro. If it passes the common file, it must be failing the 9DOF.h file before reaching the void loop(void) function,; which I think is happening with Steve's gyro. I believe the gyro fails either intialize gyro() or calibrate gyro() before reaching the void loop(void) if statement.
    Both millis() and timer can be printed before or after entering the void loop on my functioning gyro. I'm wondering if there has been an address change of some sort to Steve's new 9DOF vs. my old 9DOF board.

  5. #25
    Senior Pilot wooden's Avatar
    Join Date
    Dec 2011
    Location
    Pacific Northwest
    Posts
    4,866
    Blog Entries
    1
    Downloads
    1
    Uploads
    0
    Reputation Points (Add)
    27
    First of all, he's already shown that the gyro works using other libraries/programs. I see no reason to believe the gyro is faulty.
    Secondly, his I2C scanner output showed a device responding to address 0x68.

    The fact that 'H' never gets printed in his modified ITG3200 AQ test sketch concerns me - the code is never entering the "if ((millis() - timer) > 10)" block. It prints 'G' so it's clearly executing loop().
    push the envelope, watch it bend

  6. #26
    Senior Pilot
    Join Date
    Oct 2012
    Posts
    205
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    5
    wooden - I agree with all you wrote, so I tried the following test to see what my gyro outputs. I've included results of two runs of the code and added a delay to make results readable:
    void setup()
    {
    Serial.begin(115200);
    Serial.println("Gyroscope library test (ITG3200)");


    Wire.begin();
    Serial.print("ITG3200_IDENTITY");
    Serial.println(ITG3200_IDENTITY);
    Serial.print("GYRO_DETECTED ");
    Serial.println(GYRO_DETECTED);
    Serial.print("ACCEL_DETECTED ");
    Serial.println(ACCEL_DETECTED);
    initializeGyro();


    calibrateGyro();
    timer = millis();
    }


    void loop(void)
    {
    Serial.print(" millis()before If:");
    Serial.println(millis());
    if((millis() - timer) > 10) // 100Hz

    {
    delay(4000);
    Serial.print(" millis after if ");
    Serial.println(millis());
    // timer = millis();
    // measureGyro();


    Gyroscope library test (ITG3200)
    ITG3200_IDENTITY104
    GYRO_DETECTED 1
    ACCEL_DETECTED 2
    millis()before If:624
    millis()before If:625
    millis()before If:625
    millis()before If:626
    millis()before If:628
    millis()before If:630
    millis()before If:632
    millis()before If:634
    millis after if 4635
    millis()before If:4636
    millis after if 8636
    millis()before If:8637
    millis after if 12637
    millis()before If:12638




    Gyroscope library test (ITG3200)
    ITG3200_IDENTITY104
    GYRO_DETECTED 1
    ACCEL_DETECTED 2
    millis()before If:623
    millis()before If:623
    millis()before If:623
    millis()before If:625
    millis()before If:627
    millis()before If:629
    millis()before If:631
    millis()before If:633
    millis after if 4633
    millis()before If:4634
    millis after if 8635
    millis()before If:8635
    millis after if 12636
    millis()before If:12636
    millis after if 16636
    millis()before If:16637
    millis after if 20637
    millis()before If:20638

  7. #27
    New Recruit
    Join Date
    Jan 2014
    Posts
    15
    Downloads
    3
    Uploads
    0
    Reputation Points (Add)
    0
    nr101jw, wooden, thanks for the replies.
    nr101jw, I tried compiling the code you posted above but I have a lot of errors.

  8. #28
    Senior Pilot
    Join Date
    Oct 2012
    Posts
    205
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    5
    I believe your Aerquad Libraries are not being read by Win10. Your test program which finds your gyro works because only the Wire library is called by your test sketch. I installed Arduino v1.0.6, tried to run AQ with no luck either. V1.0.6 put an icon on the desktop. I right-clicked it and selected Properties; this shows the location of where Win10 installed the Arduino v1.0.6 folders which is where the libraries are installed. You need to copy the AQ Libraries inside of the same folder where the Arduino Libraries reside. Then things should compile for you. You should see the following when you open Arduino:
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Arduino.jpg 
Views:	151 
Size:	153.4 KB 
ID:	10638  
    Last edited by nr101jw; 02-22-2016 at 09:34 AM.

  9. #29
    New Recruit
    Join Date
    Jan 2017
    Posts
    8
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    0
    Currently compiling this code as well, will let you know if I find a solution for these errors.

  10. #30
    New Recruit
    Join Date
    Aug 2016
    Posts
    5
    Downloads
    0
    Uploads
    0
    Reputation Points (Add)
    0
    Not sure why the gyro isn't being read by AQ at this point.


 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. MacOSX configurator issues
    By adada in forum Beginner Section
    Replies: 8
    Last Post: 07-24-2014, 03:01 AM
  2. 2.1 Issues : AeroQuad Configurator wont connect!
    By Apache in forum AeroQuad Boards & Shields
    Replies: 4
    Last Post: 08-22-2012, 03:48 PM
  3. hey first flight few issues
    By SHIV15UK63 in forum General Discussion
    Replies: 1
    Last Post: 10-01-2011, 01:36 AM
  4. Configurator Connection Issues v2.5 and v2.6
    By jihlein in forum AeroQuad Configurator
    Replies: 30
    Last Post: 12-14-2010, 03:55 PM
  5. issues between USB and Configurator
    By Richard in forum AeroQuad Configurator
    Replies: 1
    Last Post: 12-04-2010, 10:37 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •