No Cyberhs, non serve ... la SoftwareSerial gestisce lei i pin e funziona bene, quindi ... è qualche altra cosa.
Busco, su che Arduino sei ? Uno, Mega, Leonardo ? Che versione dell'IDE stai usando ?
Prova con il seguente programma che è ampiamente collaudato e che uso normalmente per fare le prove con i moduli bluetooth :
// *****************************************************
//
// Bluetooth module serial communication
// Bluetooth <--> USB_Serial
//
// *****************************************************
#include <SoftwareSerial.h>
#define BT_RX 10 // PIN to receive from bluetooth
#define BT_TX 11 // PIN TO transmit to bluetooth
SoftwareSerial btSerial(BT_RX, BT_TX);
void setup()
{
delay (2000);
//
Serial.begin(9600); // Initialize USB Serial port
btSerial.begin(9600); // Initialize Bluetooth SoftwareSerial port for selected data speed
//
Serial.println("--- Ports ready ---");
Serial.println("");
//
}
void loop()
{
if (btSerial.available() > 0) Serial.write(btSerial.read());
if (Serial.available() > 0) btSerial.write(Serial.read());
}
Quello che ricevi sulla SoftwareSerial va sulla Serial e viceversa ...
Naturalmente adattalo alle velocità che stai usando.
//
// Bluetooth module serial communication
// Bluetooth <--> USB_Serial
//
// *****************************************************
#include <SoftwareSerial.h>
#define BT_RX 10 // PIN to receive from bluetooth #define BT_TX 11 // PIN TO transmit to bluetooth
SoftwareSerial btSerial(BT_RX, BT_TX);
void setup()
{
delay (2000);
//
Serial.begin(9600); // Initialize USB Serial port
btSerial.begin(9600); // Initialize Bluetooth SoftwareSerial port for selected data speed
//
Serial.println("--- Ports ready ---");
Serial.println("");
//
}
void loop()
{
if (btSerial.available() > 0) Serial.write(btSerial.read());
if (Serial.available() > 0) btSerial.write(Serial.read());
}
Quello che ricevi sulla SoftwareSerial va sulla Serial e viceversa ...
Naturalmente adattalo alle velocità che stai usando.
Guglielmo
Ho provato lo scambio delle informazioni tra le 2 porte però visto che non funzionava
ho semplificato per la ricerca del problema