Witam, od niedawna jestem użytkownikiem arduino, na początek postanowiłem pobawić się z modułem GSM neoway M590, udało mi się podłączyć (nie wiem czy dobrze) - dioda mruga po podłączeniu do zasilania.
Posiadam dokładnie taki moduł:
i tak:
I - PUste
T - Tu mam podpięte TX z arduino
R - RX z arduino
U - 3.3v z arduino
K - PUSTE
G - MASA
No i wiadomo z drugiej strony masa i 5v.
i teraz jak podłącze arduino pod usb - nic się nie dzieje, natomiast jak połączę na chwilę G z K to moduł tak jakby "startuje" i zaczynają mrugac 2 diody.
Pierwsze pytanie brzmi - czy dobrze to podłączyłem?
Drugie pytanie brzmi - jeżeli dobrze to podłączyłem to dlaczego jak załaduję ten kod:
Na monitorze portu szeregowego wyświetla mi się tylko: SMS Messages Sender i nic dalej nie idzie?
Jestem początkujący więc proszę o wyrozumiałość, dzięki z góry!
Posiadam dokładnie taki moduł:
i tak:
I - PUste
T - Tu mam podpięte TX z arduino
R - RX z arduino
U - 3.3v z arduino
K - PUSTE
G - MASA
No i wiadomo z drugiej strony masa i 5v.
i teraz jak podłącze arduino pod usb - nic się nie dzieje, natomiast jak połączę na chwilę G z K to moduł tak jakby "startuje" i zaczynają mrugac 2 diody.
Pierwsze pytanie brzmi - czy dobrze to podłączyłem?
Drugie pytanie brzmi - jeżeli dobrze to podłączyłem to dlaczego jak załaduję ten kod:
Kod:
// Include the GSM library
#include <GSM.h>
#define PINNUMBER ""
// initialize the library instance
GSM gsmAccess;
GSM_SMS sms;
void setup() {
// 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");
// connection state
boolean notConnected = true;
// Start GSM shield
// If your SIM has PIN, pass it as a parameter of begin() in quotes
while (notConnected) {
if (gsmAccess.begin(PINNUMBER) == GSM_READY) {
notConnected = false;
Serial.println("xxx");
} else {
Serial.println("Not connected");
delay(1000);
}
}
Serial.println("GSM initialized");
}
void loop() {
Serial.print("Enter a mobile number: ");
char remoteNum[20]; // telephone number to send sms
readSerial(remoteNum);
Serial.println(remoteNum);
// sms text
Serial.print("Now, enter SMS content: ");
char txtMsg[200];
readSerial(txtMsg);
Serial.println("SENDING");
Serial.println();
Serial.println("Message:");
Serial.println(txtMsg);
// send the message
sms.beginSMS(remoteNum);
sms.print(txtMsg);
sms.endSMS();
Serial.println("\nCOMPLETE!\n");
}
/*
Read input serial
*/
int readSerial(char result[]) {
int i = 0;
while (1) {
while (Serial.available() > 0) {
char inChar = Serial.read();
if (inChar == '\n') {
result[i] = '\0';
Serial.flush();
return 0;
}
if (inChar != '\r') {
result[i] = inChar;
i++;
}
}
}
}
Na monitorze portu szeregowego wyświetla mi się tylko: SMS Messages Sender i nic dalej nie idzie?
Jestem początkujący więc proszę o wyrozumiałość, dzięki z góry!