Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: issue with gps

  1. #1
    Junior Member
    Join Date
    Sep 2018
    Posts
    6

    issue with gps

    Hi,
    While I don't think the hardware is material to my issue, for the sake of completeness: I'm using a Teensy 3.5 and Adafruit's ultimate GPS module.
    I started off with a more complex version of gpstest3.ino (the attached project includes the .cpp and .h file). The attached gpstest3.ino has been stripped down but it simply doesn't work. It compiles fine but does not throw information to the serial monitor. I am using essentially the same code is in gpstest4.ino but gps-related code is in a separate class.
    As part of my debugging, I created gpstest4.ino and it works fine, ie it prints the time on the serial monitor.

    I cannot see what I am missing. If anyone has any suggestions or could point me towards material on why gpstest3.ino is not working, that would be greatly appreciated.

    Thank you,
    Dom
    Attached Files Attached Files

  2. #2
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    507
    Hi,

    Its my guess you probably need mygps.ugps() in the setup section.

    Cor

  3. #3
    Junior Member
    Join Date
    Sep 2018
    Posts
    6
    Thanks Cor.
    I did that and get
    error: invalid use of 'ugps::ugps'
    mygps.ugps;

    That's not surprising in hindsight.

    I was thinking that perhaps the GPS serial connection needs to be started in the setup scope not before and I created a ugps::gpssetup() function which starts the Serial1 connection. Again it compiles without errors or warnings but I cannot see the output.

    Cheers.
    Attached Files Attached Files

  4. #4
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    507
    mygps.ugps() .... not mygps.ugps;

  5. #5
    Junior Member
    Join Date
    Sep 2018
    Posts
    6
    I tried that too with the same outcome.

  6. #6
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    507
    Than I would keep the gpstest4.ino as a working model.

  7. #7
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    1,070
    > Adafruit_GPS _uGPS(&GPSSerial);

    This line in your constructor creates another local only shadow _uGPS - which isn't what you want.

  8. #8
    Junior Member
    Join Date
    Sep 2018
    Posts
    6
    I found a work around which works and allows for having the GPS related stuff in separate .cpp and .h files, keeping the code cleaner. Cheers!
    Attached Files Attached Files

Posting Permissions

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