ผมได้ทำการเขียนโปรแกรมใส่เข้าไปยัง arduino เรียบร้อยแล้วครับ
ตามนี้เลย
#include <SoftwareSerial.h>
SoftwareSerial SIM900(15,14); // RX | TX
void setup()
{
SIM900.begin(9600);
Serial.begin(9600);
}
void sendSMS()
{
SIM900.print("AT+CMGF=1\r");
delay(500); // AT command to send SMS message
SIM900.println("AT+CMGS=\"+6684503xxxx\"\r"); // recipient's mobile number, in international format
delay(500);
SIM900.println("Arduino"); // message to send
delay(500);
SIM900.println((char)26); // End AT command with a ^Z, ASCII code 26
delay(500);
}
void loop()
{
sendSMS();
do {} while (1);
}
จากนั้นผมก็ต่อ tx ขา 14 ของ arduino เข้า rx ของ sim900 และต่อ rx ขา 15 เข้า tx ของ sim900
แต่ทดสอบแล้วไม่ส่งข้อความตามที่เขียนเลยครับ
เงียบกริ๊ปเลย
ไม่ทราบว่าผมทำผิดขั้นตอนไหนมั้ยครับ
ขอคำแนะนำจากอาจารย์ทุกท่านด้วยครับ
ตามนี้เลย
#include <SoftwareSerial.h>
SoftwareSerial SIM900(15,14); // RX | TX
void setup()
{
SIM900.begin(9600);
Serial.begin(9600);
}
void sendSMS()
{
SIM900.print("AT+CMGF=1\r");
delay(500); // AT command to send SMS message
SIM900.println("AT+CMGS=\"+6684503xxxx\"\r"); // recipient's mobile number, in international format
delay(500);
SIM900.println("Arduino"); // message to send
delay(500);
SIM900.println((char)26); // End AT command with a ^Z, ASCII code 26
delay(500);
}
void loop()
{
sendSMS();
do {} while (1);
}
จากนั้นผมก็ต่อ tx ขา 14 ของ arduino เข้า rx ของ sim900 และต่อ rx ขา 15 เข้า tx ของ sim900
แต่ทดสอบแล้วไม่ส่งข้อความตามที่เขียนเลยครับ
เงียบกริ๊ปเลย
ไม่ทราบว่าผมทำผิดขั้นตอนไหนมั้ยครับ
ขอคำแนะนำจากอาจารย์ทุกท่านด้วยครับ