Hot answers tagged

7

The Neo 6M takes a bit of time to fix when first powered on. If your board is fitted with a small battery it will most probably be flat and will take an hour or two to charge up. It is there to provide charge to the EEPROM and the onboard RTC. Also check that the leads on the battery are not shorting. You do not get a valid data sentence out of the GPS ...


6

Photo by John Boxall Which pins do they use? To determine if two shields are compatible, you have to read the specifications of both shields. The best source for this information is the data sheets supplied with the shields. However there is also this Shield List Can you reassign pins? Some shields provide a means to alter which pins are used for ...


5

You could do a qsort. You haven't posted any data types so it is hard to answer with your specific code, however here is a sample of sorting numbers: const int COUNT = 10; int someNumbers [COUNT] = { 7342, 54, 21, 42, 18, -5, 30, 998, 999, 3 }; // callback function for doing comparisons int myCompareFunction (const void * arg1, const void * arg2) { ...


5

The speed value is correct, like TisteAndi said. Your GPS location "wanders" around the same way. You can simply ignore small speed values. One problem you may not be aware of yet: the printing isn't really coordinated with the GPS updates. Sometimes that doesn't matter, but if you want your speed to update every second, you'll need to synchronize the ...


4

The simple thing would be for your sketch to read from the serial port continuously. If it finds something it stores it and when a newline arrives it sees if that happens to be a password known only to you. So, for example, all you would have to do is plug in the USB cable, activate the Serial Monitor on your PC, type swordfish and the servo opens the box. ...


4

No floating point for sprintf, it prints a '?'. The functions sprintf, sscanf and the alike functions (snprintf and others) do not have floating point support for avr microcontrollers. History One of the first Arduino boards used the Atmega8 microcontroller with only 8k flash and 1k sram. It was important to be very memory efficient. The gcc compiler did ...


3

Is not really connecting GPS to IMU, is more like you read GPS values, read IMU values and after apply what is called a sensor fusion algorithm. One of the most common used sensor fusion algorithms is called Kalman filter (the Extended Kalman Filter more likelly). However, if you do not have some basis on control theory you may have more trouble in ...


3

This could be a general programming question. The only thing specific to Arduino here is that you may want a solution that minimizes the use of memory and avoids floating point operations. Here is a memory-friendly solution that reformats the string in place, i.e. it overwrites the original string. In many cases this is appropriate, as it is unlikely that ...


3

Since you only need to know the 4 largest values in the array you don't need to sort the array, you just need to iterate through it and find the four largest values. This can be done in O(n*k) which is faster than any sorting algorithm you could use. However there is an issue of space since you would use an array to hold the previous largest numbers. ...


3

I assume that by I'm also really looking for the avg Top 4 values. you mean that you will find the largest four numbers and report their average. If so, you can sort all the values (as in previous answer) and then average the last four numbers (or first four, depending on sort order) from the sorted array. This has complexity O(n lg n), that is, sort ...


3

But when after setting the Longitude and Latitude to float.When I use this code, I don't get a valid gps data. Some statements in C/C++ are not what they might seem. The value of the statements: Longitude = (sim808.GPSdata.lon, 10 ); Latitude = (sim808.GPSdata.lat, 10 ); Are actually the same as: sim808.GPSdata.lon; Longitude = 10; sim808.GPSdata.lat;...


3

You forgot the , 8 from your println that specifies that it should print 8 decimal places. Instead you seem to have added it to the end of an assignment which makes absolutely no sense whatsoever. double latcord = gps.location.lat(); double lngcord = gps.location.lng(); Serial.println(latcord, 8); Serial.println(lngcord, 8);


3

Most of the GPS modules keep on sending the data in the NMEA format whether they have a GPS fix or not, however, you can parse the GPS data to find whether the data is the latest data received from the GPS or not. If you look at the definition of the NMEA data here, there are a few variables in the data that you can use to find whether the data is the latest ...


2

Check this shield out, it sounds almost exactly like what you need, plus it has OBD2 (CAN) access to log RPM, indicated speed, steering wheel angle, and whatever else your car exposes. You can get a GPS module from Sparkfun as well. Matter of fact, I'm using it in a very similar project, but development is paused until I upgrade to a Mega, since I've run out ...


2

The newest code i have posted works 100%! So if you have similar problems with that aweful gps, use this! Apparently, TinyGPS and TinyGPS++ don't work well with this gps. To be precice, there is a problem with the gps.encode(c) function. So using if (gps.encode(c)) most of the times returns false, except some rare occasions which returns true and then you ...


2

A-GPS uses a network connection to download GPS almanac and ephemeris data to enable satellites to be located faster. Otherwise the GPS device has to wait for the data to be sent by a satellite, which may take up to 12.5 minutes. Alternatively, the GPS device can send noise GPS data to an assistance server which will process it and send back a fix. A-GPS ...


2

Ints and unsigned ints are 16 bits on AVR ATmegas. So while the argument passed is a 32-bit value, sprintf() is expecting a 16 bit value. The stack is packed with twice as much data as needed. From the "2,0,4964" bit, it looks like it taking part of the previous/next parameter during processing, which makes me think this even more. You need to use long ...


2

Your uBlox LEA 6H is most likly configured to use the UBX binary protocol and not NMEA at all. This protocol, as well as how to switch your LEA 6H between NMEA and UBX is in this document, from the uBlox website: http://www.u-blox.com/images/downloads/Product_Docs/u-blox6_ReceiverDescriptionProtocolSpec_%28GPS.G6-SW-10018%29.pdf You may be able to use the ...


2

Consider TinyGPS++ over TinyGPS only if you are running on Due or processor which can take advantage of the higher precision of 64-bit “double” floating-point. char data; should be double data;. You're wasting resources otherwise. data=(gps.location.lat(), 6); isn't how you do it. You only need to specify precision when writing to Serial, like Serial.print(...


2

There doesn't seem to be, but what you could do is print each character as it arrives. From their example code: while (nss.available()) { if (gps.encode(nss.read())) // <--- pass to TinyGPS return true; } So, change that to be: while (nss.available()) { char c = nss.read(); // <--- get the incoming character Serial....


2

I assume you're using TinyGPS which I sourced from https://github.com/mikalhart/TinyGPS I've recently done a similar thing - just trying to get the gps to work and give me as much data as possible. The code I used to do this is here: #include "TinyGPS.h" #define GPS_BAUD 115200 #define PC_BAUD 115200 TinyGPS gps; int led1 = 13; long lat, lon; ...


2

RX of the Arduino (pin 4, according to the SoftwareSerial statement) goes to the TX of the GPS. Arduino pin 3 (ss TX) goes to the GPS RX. And you should use pins 8 & 9 instead. That would let you use AltSoftSerial, the best choice when you can't use HardwareSerial (i.e., Serial). If you can't use pins 8 & 9, then NeoSWSerial is a better choice ...


2

You cannot get GPS data without getting GPS data. That's like wanting to get milk from a cow without using a cow. Some GSM modem modules also include a GPS chip. If yours does you can use that. If not then the closest you can get is: Country (or maybe city) the IP address is registered in Cell ID and location of the tower you are communicating with Both ...


2

That is a perfect printout of a GPS system that can see zero satellites. The fact that the timestamps are one second apart shows that you have correctly interfaced with the GPS device. Now, the GPS device has to 'interface' with the satellites! Many people don't realise two things: The GPS antenna really does need a clear view of the sky. A tiny view ...


2

From https://www.arduino.cc/en/Reference/softwareSerial: Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69). So you will need to use one of the pins from that list for RX, pin 4 or 5 ...


1

It appears the GSM library has its own conflicting copy of SoftwareSerial, and not necessarily a matching version unless you're lucky. Not sure how well this would work but you can try removing the library reference to SoftwareSerial, and fiddle about to use the GSM library's SoftwareSerial.


1

This is where those dreaded maths classes come in. You know - the ones where no one paid attention because you thought "Where in the real world would I ever want to know this stuff?" Well, right here is were you would want to know this stuff. The distance between two points on a 2D plane (i.e., a map) can be looked at as two vertices of a right-angled ...


1

You could check out the codes for this reverse geocaching project at https://learn.adafruit.com/reverse-geocache-engagement-box/software or the dog collar project at https://learn.adafruit.com/gps-dog-collar to get some help. For my GPS project I just wanted to display the distance and speed, so all I had to do was save the current location, subtract it from ...


1

Until you have the correct baud rate and good satellite reception, many fields will be zero or empty. I wrote a diagnostic program for NeoGPS that will try different baud rates and confirm that the GPS device is functioning. The example program is in this directory: examples/NMEAdiagnostic Installation instructions are here. If you're inside, you may ...


1

After 2 days of troubleshooting I found the solution Use 3.3 volt external supply Use voltage dividers to make 3.3 volt compatible to module go outside(open space) That's it


Only top voted, non community-wiki answers of a minimum length are eligible