Hello,
I do not speak English, I use google translate to write. Accept my apologies.
I use a card NANO / 328 and would like to install a second serial port to control a GSM modem.
#include <SoftwareSerial.h> does not. (Compilation error) but
see note below#include <NewSoftSerial.h> does not. (Compilation error)
So I search a library that works
Thank you for helping me.
-----------------------------
Bonjour,
Je ne parle pas l'anglais, j'utilise Google traduction pour écrire. Acceptez mes excuses.
J'utilise une carte NANO/328 et je voudrais installer un 2ème port série pour piloter un modem GSM.
#include <SoftwareSerial.h> ne fonctionne pas. (erreur à la compilation) mais voir note ci-dessous
#include <NewSoftSerial.h> ne fonctionne pas. (erreur à la compilation)
Je recherche donc une library qui fonctionne.
Merci de m'aider.
-----------------------
An excerpt of my code: / Un extrait de mon code :
#include <SoftwareSerial.h> //for the 2nd harbor // pour le 2 ème port
#define rxPin 6 // signaux (GSM --> NANO)
#define txPin 5 // signaux (NANO -->GSM)
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin); // Initialize mySerial // initialisation mySerial SoftwareSerial
//void setup() {
Serial.begin(9600); // Port série N° 1 port USB ---> moniteur
pinMode(rxPin, INPUT); // Set pin mode to input for Software serial RX Pin
pinMode(txPin, OUTPUT); // Set pin mode to output for Software serial TX Pin
mySerial.begin(9600); // Port série N°2 ---> modem GSM
// ...
// initializing ext interruptions. by PCINT1 // initialisation des interruptions ext. par PCINT1
PCMSK1 |= B00011111; // PCINT 8 à 12 autorisée
PCICR |= B010; // groupe PCIE1 = 1 (PCINT 8 à 12)
PCIFR |= B010; // pour effacer le flag PCIF1
// ....
Note the code : Nota sur le code :
By removing the line 233 // En supprimant la ligne 233 (ISR(PCINT1_vect, ISR_ALIASOF(PCINT0_vect));
- No compilation errors, interruptions PIC PORTC NT1 working properly.
- Serial port works with many random errors. (Conflicts ?)
- When the serial port # 1 (USB) is not connected, the port No. 2 does not?
- pas d'erreur de compilation, les interruptions PCINT1 PortC fonctionnent correctement.
- port série fonctionne aléatoirement avec nombreuses erreurs. (conflits ?)
- lorsque le port série N°1 (USB) n'est pas connecté, le port N°2 ne fonctionne pas ?
thank you in advance