Centrado / z-blockly-tracker

0 stars 0 forks source link

Send call #341

Open roshan1centrado opened 1 year ago

roshan1centrado commented 1 year ago

Send call

image

C++


void setup()
{
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(9600);

  Serial.println("Initializing..."); 
  delay(1000);

  mySerial.println("AT"); //Handshaking with SIM900
  updateSerial();

  mySerial.println("ATD+ +ZZxxxxxxxxxx;"); //  change ZZ with country code and xxxxxxxxxxx with phone number to dial
  updateSerial();
  delay(20000); // wait for 20 seconds...
  mySerial.println("ATH"); //hang up
  updateSerial();
}

void loop()
{
}

void updateSerial()
{
  delay(500);
  while (Serial.available()) 
  {
    mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
  }
  while(mySerial.available()) 
  {
    Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
  }
}

Originally posted by @Maharajacentrado in https://github.com/kreativhut/z-blockly-tracker/discussions/252#discussioncomment-3260429

roshan1centrado commented 1 year ago
image

(i) if I place the GSM block inside the if condition or inside void loop the code should appear inside it.

(ii) if I place the two gsm blocks then the native code for last gsm code is appearing both should appear.

the following lines of code should change accordingly other lines are same:

  mySerial.println("AT"); //Handshaking with SIM900
  updateSerial();

  mySerial.println("ATD+ +ZZxxxxxxxxxx;"); //  change ZZ with country code and xxxxxxxxxxx with phone number to dial
  updateSerial();
  delay(20000); // wait for 20 seconds...
  mySerial.println("ATH"); //hang up
  updateSerial();