I'm working on a project that require me to send AT commands from arduino to a development board, before I start my project code, I wrote a small code to make sure AT commands are sent successfully, the follow code is used to shutdown the development board, but It doesn't work, anyone done this before? please help. Thanks
#include <NewSoftSerial.h>
#include <Wire.h>
int tx=2;
int rx=3;
NewSoftSerial transmit(rx,tx); // defines the rx/tx pins (rxpin,txpin)
void setup()
{
Serial.begin(9600);
transmit.begin(9600);
pinMode(tx,OUTPUT);
pinMode(rx,INPUT);
}
void loop()
{
digitalWrite(tx,HIGH);
delay(1000);
transmit.println("AT\r");
delay(1000);
transmit.println("AT+CPOWD=1\r");
delay(7000);
digitalWrite(tx,LOW);
}
I searched online, people say, we need to put \r after an AT command, that's why I put it on, but i tried both AT\r and AT, it didn't work. The link below is the development board I'm using.
I also tried to use arduino pin 0 and 1, 0 is the rx, and 1 is the tx, and connect Arduino tx to rx , rx to tx with the other board,but no difference.
I think I did send my text over to the board, because, when I just got the development board, there were 3 flashing LED on it, then i started to transmit my at command to it, the LEDs stopped flashing. But somehow the command doesn't work, anyone have any idea?