Buenas ! Perdonar el retraso, tengo el Arduino Mega 2560.
No tengo ninguno de los otros, pero me resulta extraño que no funcione.
También he probado a cambiar el rx y tx por 0 y 1, ya que se pincha en la shield en dichos pins, y tampoco va.
Cuando me refiero a que no me va, es que no responde a las ordenes y a que únicamente manda cuando dejo pulsado el reset del Mega.
La única manera que me envie solo sin tener que pulsar el reset, es escribiendo el siguiente código:
void setup(){
}
void loop(){
}
Pero creo que ahi no tiene sentido ya que digo yo que para algo se necesitará el código que utilizais en el tutorial.
El código que utilizo, es el que poneis en el tutorial( el que no me funciona mas que con el reset):
/*
* Copyright (C) 2010 Libelium Comunicaciones Distribuidas S.L.
*
http://www.libelium.com *
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Version 0.1
* Author: Marcos Yarza
*/
// include the SoftwareSerial library
#include <SoftwareSerial.h>
// Constants
#define rxPin 9 //rx pin in gps connection
#define txPin 8 //tx pin in gps connection
// set up the serial port
SoftwareSerial gps = SoftwareSerial(rxPin, txPin);
// variables
byte byteGPS = 0;
int i = 0;
int h = 0;
// Buffers for data input
char inBuffer[300] = "";
char GPS_RMC[100]="";
char GPS_GGA[100]="";
void setup(){
//setup for mySerial port
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
gps.begin(4800);
//setup for Serial port
Serial.begin(19200);
delay(1000);
}
void loop(){
// Read the RMC sentence from GPS
byteGPS = 0;
byteGPS = gps.read();
while(byteGPS != 'R'){
byteGPS = gps.read();
}
GPS_RMC[0]='$';
GPS_RMC[1]='G';
GPS_RMC[2]='P';
GPS_RMC[3]='R';
i = 4;
while(byteGPS != '*'){
byteGPS = gps.read();
inBuffer[i]=byteGPS;
GPS_RMC[i]=byteGPS;
i++;
}
// Read GGA sentence from GPS
byteGPS = 0;
byteGPS = gps.read();
while(byteGPS != 'A'){
byteGPS = gps.read();
}
GPS_GGA[0]='$';
GPS_GGA[1]='G';
GPS_GGA[2]='P';
GPS_GGA[3]='G';
GPS_GGA[4]='G';
GPS_GGA[5]='A';
i = 6;
while(byteGPS != '*'){
byteGPS = gps.read();
inBuffer[i]=byteGPS;
GPS_GGA[i]=byteGPS;
i++;
}
// print the GGA sentence to USB
Serial.print("GGA sentence: ");
h = 0;
while(GPS_GGA[h] != 42){
Serial.print(GPS_GGA[h],BYTE);
h++;
}
Serial.println();
// print the RMC sentence to USB
Serial.print("RMC sentence: ");
h = 0;
while(GPS_RMC[h] != 42){
Serial.print(GPS_RMC[h],BYTE);
h++;
}
Serial.println();
}
Gracias