Connect with us

programming arduino

Discussion in 'Microcontrollers, Programming and IoT' started by bobdxcool, Feb 17, 2013.

Scroll to continue with content
  1. bobdxcool


    Mar 9, 2012
    I need to send data when a condition is met from a gps module to mobile using gsm module.

    I have used ports 3,4 for gps and pots 7,8 for gsm. I have used softwareserial.

    I also tried 0,1 for gps and 7,8 for gsm; and vice versa.

    The problem is that as soon as the condition is satisfied and msg is sent, the program gets stuck, it doesn't return back to the void loop.

    So, I tried using goto statement, but am getting compile error

    This is message sending function

    I tried using goto mand; at the end of this routine, and I tried to put the label "mand" in the beginning of the void loop function and also before, but I am getting compile errors

    I am confused how to write this goto function. Could anyone help?

    Are there any other alternatives?
  2. Phiber


    Sep 14, 2012
    maybe your do while loop is causing an infinite loop.
    your condition is 'while(1>0)' and 1 will always be greater than 0 so it just loop back to the delay?
  3. bobdxcool


    Mar 9, 2012
    I tried removing the do while loop...

    no difference at all, still getting stuck

    to make it worse,now gsm is sending multiple messages instead of one.
  4. OddOne


    Feb 26, 2013
    Have you tried the if?

    The condition is true when the condition is met from a gps module to mobile using gsm module and false after the message is send.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day