Running SparqEE Cell without Arduino Shield and using Hardware Serial 1 (Arduino Mega)

The SparqEE CELLv1.0 device.
alonsortan
Posts: 7
Joined: Thu Jun 23, 2016 1:56 am

Running SparqEE Cell without Arduino Shield and using Hardware Serial 1 (Arduino Mega)

Postby alonsortan » Mon Jul 18, 2016 7:12 pm

Hi I will like to find out how can I re-edit the codes in the Arduino shield example so that I am able to use Hardware Serial port 1 of Arduino Mega.
Here is my code to test the response of the SparqEE Cell. It works only when SparqEE Cell Tx->RX0 and Rx->TX0. The 1st code is tested using serial 0 of Arduino Mega. It is able to pick up the response and show on the serial monitor.

Code: Select all

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}
void loop() {
  Serial.print("ate0\r");
  getResponse();
}

void getResponse(void) {
    String response = "";
    while(Serial.available()!=0){
        response += (char)Serial.read();
    }
    Serial.print(response);
    delay(2000);
}


The next code is when i change the following: Tx->Rx1 and Rx->Tx1 (Physical pins) and the changes in codes as shown. But nothing is showing up on the serial monitor. why is it so?

Code: Select all

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial1.begin(9600);
}
//-----------------------------------------------------------------------------
// LOOP -----------------------------------------------------------------------
//-----------------------------------------------------------------------------

void loop() {
  Serial1.print("ate0\r");
  getResponse();
}

void getResponse(void) {
    String response = "";
    while(Serial1.available()!=0){
        response += (char)Serial1.read();
    }
    Serial.print(response);
    delay(2000);
}

User avatar
donjohnii
Site Admin
Posts: 686
Joined: Tue Jul 30, 2013 2:19 pm

Re: Running SparqEE Cell without Arduino Shield and using Hardware Serial 1 (Arduino Mega)

Postby donjohnii » Thu Apr 13, 2017 5:20 am

Search the forum for Mega. Should have addressed this previously. Not much is different... the mega you'll be able to use a 2nd HW serial output. Just make sure the voltage is right


Return to “CELLv1.0”

Who is online

Users browsing this forum: No registered users and 1 guest