0

I have the following code

#include <SoftwareSerial.h>

byte RX = 10;
byte TX = 11; 
SoftwareSerial *A7board = new SoftwareSerial(RX, TX); 

void print_result()
{
  Serial.print("A7 board info: ");
  while( A7board->available() != 0)
    Serial.write( A7board->read());
  Serial.println();  
}

void setup() {
  Serial.begin(115200);
  A7board->begin(115200);
  delay(200); 

  Serial.println("Send AT command");  
  A7board->println("AT");
  delay(25000);
  print_result();

  Serial.println("AT+GPS turn on");  
  A7board->println("AT+GPS=1");  
  delay(10000);
  print_result();

  Serial.println("AT+GPSRD turn on");  
  A7board->println("AT+GPSRD=1");  
  delay(10000);
  print_result();

}

void loop() {
  print_result();
  delay(2000);
}

This is the AI Thinker A7 documentation (I googled it): http://www.communica.co.za/Content/Catalog/Documents/D1266435144.pdf?fbclid=IwAR0TmqhxMILHbgxFfsKIa5bPz3LuCFoi8JbwcQyTXEhiCe7Q-AYrzd2-T1I

This is the wiring.

But I am not getting any data.

Output:

What mistake am I making? I cannot get it running. (PS: I am a newbie in electronics.)

  • are you sure that you are using the correct pins for software serial? – jsotola May 10 at 20:32
  • the pdf shows SoftwareSerial on pin 7,8 and you use 10 and 11 – Juraj May 11 at 5:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.