GPS + RF433 Not working together.
-
What output you are getting? Just some zeros?
-
@salmanfaris No any output. Arduino not wating for GPS data.Not runing this loop
while (gps.available( gps_port ))
-
does it return one/true when you are testing only with gps and gps.available( gps_port )?
-
@salmanfaris gps.available( gps_port ) Is not return a True case.
-
@salmanfaris for running
while(gps.avaible());
MCU need to wait some time. but after adding VirtualWire library it's not waiting for Serial.available() -
@rafitc99 said in GPS + RF433 Not working together.:
ps.available( gps_port ) Is not return a True case.
Then how is the while loop will work? It should return!
-
@rafitc99 said in GPS + RF433 Not working together.:
library it's not waiting for Serial.available()
did you try manual waiting? Instead of delay, you can use mills, so the background works will keep run.
-
@salmanfaris said in GPS + RF433 Not working together.:
@rafitc99 said in GPS + RF433 Not working together.:
library it's not waiting for Serial.available()
did you try manual waiting? Instead of delay, you can use mills, so the background works will keep run.
Let me try.
-
did you try manual waiting? Instead of delay, you can use mills, so the background works will keep run.
Not working. Same problem.
-
@salmanfaris It's worked. Thank you @salmanfaris for your replies.
Actually a small change in void loop is the solution
void loop(){ // Set buffer to size of expected message uint8_t buf[1]; uint8_t buflen = sizeof(buf); // Check if received packet is correct size if (vw_get_message(message, &messageLength)) // non-blocking { Serial.print("Potentiometer: "); //Serial.print(message[i]); received_number = message[i]; Serial.println(received_number); } if(received_number == 1){ getGpsData(); } }
Used two simple if instead of Nested IF. idk what is the problem of first code. Also if I add any
delay()
insidevoid getGpsData()
function, showing same problem.