raushankumar586
Junior Member level 1
Hello guys,
I am implementing states for connecting pic microcontroller to sim800 module.
here is the code written in main:
my code is stucking in becoz of following line of codes
can anyone help me out
I am implementing states for connecting pic microcontroller to sim800 module.
here is the code written in main:
Code:
while (1) {
delay(2);
timeFromBoot();
if (state == 1) {
refTime = time;
checkStart();
if (checkStartsuccess == 1) {
printToArduino("I am in state 1\n");
nextState();
} else {
while ((checkStartsuccess != 1) || (time - refTime) > 10) {
timeFromBoot();
checkStart();
}
}
delay(40);
}
if (state == 2) {
checkNetwork();
while (checkNetworksuccess != 1) {
// if (timeFromBoot() - refTime > 30) {
// state = 2;
// break;
// }
}
printToArduino("I am in state 2\n");
delay(80);
nextState();
}
if (state == 3) {
checkGprsCon();
while (checkGprssuccess != 1) {
// if (timeFromBoot() - refTime > 30) {
// state = 3;
// break;
// }
}
printToArduino("I am in state 3!!\n");
delay(80);
nextState();
}
state = 1;
}
Code:
while ((checkStartsuccess != 1) || (time - refTime) > 10) {
timeFromBoot();
checkStart();
}
can anyone help me out