Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SoftwareSerial.h>
- SoftwareSerial pdu_serial(2,3);
- void setup() {
- String msg = "Hello world PDU";
- String num = "+639175090208";
- // initialize serial communications and wait for port to open:
- Serial.begin(9600);
- while (!Serial) {
- ; // wait for serial port to connect. Needed for native USB port only
- }
- Serial.println("SMS Messages Sender");
- Serial.println(num);
- Serial.println(msg);
- pdu_serial.begin(9600);
- while (!pdu_serial) {
- ; // wait for serial port to connect. Needed for native USB port only
- }
- pdu_serial.print("AT+CMGF=1\r");
- delay(2000);
- pdu_serial.print("AT+CMGS=\"" + num + "\"\r");
- delay(1000);
- pdu_serial.print(msg);
- delay(1000);
- pdu_serial.write((char)26); //ctrl+z
- Serial.println("\nCOMPLETE!\n");
- }
- void loop() {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement