Updated software serial pull rate
This commit is contained in:
		
							parent
							
								
									5e48c293bf
								
							
						
					
					
						commit
						6cd65f0a8f
					
				
							
								
								
									
										10
									
								
								collar.ino
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								collar.ino
									
									
									
									
									
								
							| @ -44,12 +44,15 @@ void loop() { | ||||
|     Serial.println(); | ||||
|   } | ||||
| 
 | ||||
|   if (ss.available() > 0) | ||||
|     gps.encode(ss.read()); | ||||
| 
 | ||||
|   unsigned long currentMillis = millis(); | ||||
|   if (currentMillis - previousMillis >= interval) { | ||||
|     previousMillis = currentMillis; | ||||
|      | ||||
|     // Gather GPS data
 | ||||
|     if (gps.encode(ss.read()) && gps.location.isValid()) { | ||||
|     if (gps.location.isValid()) { | ||||
|       Serial.println("Valid GPS"); | ||||
|       lat = gps.location.lat(); | ||||
|       lng = gps.location.lng();  | ||||
| @ -70,13 +73,10 @@ void loop() { | ||||
|        | ||||
|       if (!status) { | ||||
|         Serial.println("Failed to encode");   | ||||
|       } else { | ||||
|         Serial.print("Status: "); | ||||
|         Serial.println(status);   | ||||
|       } | ||||
| 
 | ||||
|       Serial.print("Sending packet Lat / Long: "); | ||||
|       Serial.print(lat); | ||||
|       Serial.println(lat); | ||||
|       Serial.println(lng); | ||||
| 
 | ||||
|       // send packet
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user