issue with gps

duschl

Member
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
 

Attachments

  • gpstest4.ino
    1,012 bytes · Views: 65
  • gpstest3.ino
    196 bytes · Views: 58
  • ugps.cpp
    808 bytes · Views: 54
  • ugps.h
    304 bytes · Views: 54
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.
 

Attachments

  • gpstest3.zip
    1.5 KB · Views: 59
> Adafruit_GPS _uGPS(&GPSSerial);

This line in your constructor creates another local only shadow _uGPS - which isn't what you want.
 
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!
 

Attachments

  • gpstest3.zip
    1.5 KB · Views: 59
Back
Top