buenas, tengo varios dias con esto y no encuentro el error,envio datos desde VB6 a la placa arduino mega 2560, y no envia el mensaje
el dato que se envia es un nro. de telefono ejemplo 17864443322
Private Sub Command1_Click()
With MSComm1
If .PortOpen = False Then .PortOpen = True
Dim dataa As String
For i = 1 To Len(txtNumber.Text)
dataa = Mid(txtNumber.Text, i, 1)
.Output = dataa
Next i
End With
MSComm1.PortOpen = False
end sub
' configuracion del puerto
MSComm1.CommPort = 5
MSComm1.Settings = "9600,N,8,1"
MSComm1.EOFEnable = True
MSComm1.InputLen = 1
MSComm1.RThreshold = 4
MSComm1.PortOpen = True
codigo en arduino
char inData[11]; // Allocate some space for the string
char inChar; // Where to store the character read
byte index = 0; // Index into array; where to store the character
char incomingByte=0; //Will hold the incoming character from the Serial Port.
char mobilenumber; // Replace xxxxxxxx with the recipient's mobile number
void setup() {
Serial.begin(9600);
Serial.flush();
Serial1.begin(9600); //GSM
Serial.println("Em comunicacao...");
delay(15000); // give the GSM module time to initialise, locate network etc.
}
void loop() {//GSM
//If a character comes in from the cellular module...
// he colocado if (Serial1.available() > 0) tambien y nada que trabaja
if (Serial.available() > 0) {
// lee el byte entrante:
if(index < 10) {
inChar = Serial.read(); // Read a character
inData[index] = inChar; // Store it
index++; // Increment where to write next
inData[index] = '\0'; // Null terminate the string
}
}
Serial1.println("AT+CMGF=1"); // set SMS mode to text
Serial1.print("AT+CMGS=");
Serial1.print(34,BYTE); // ASCII equivalent of "
Serial1.print(inData);
Serial1.println(34,BYTE); // ASCII equivalent of "
delay(500); // give the module some thinking time
Serial1.print("dime si llego el msg");
Serial1.println(26,BYTE); // ASCII equivalent of Ctrl-Z
delay(10000); // the SMS module needs time to return to OK status
Serial.print("Msg enviada desde vb.net");
do // loop temp just to test sketch
{
delay(1);
} while (1>0);
}
que es lo malo que estoy haciendo, gracias por su ayuda