mah in verità nemmeno io.......cmq appena ho decommentato il Serial.begin ha smesso di dare i caratteri strani, che si vedevano sin dalla fase di setup, quando stampava "Starting System"
#include <SoftwareSerial.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Keypad_I2C.h>
#include <Keypad.h>
#include "sms.h"
#include "SIM900.h"
#include "call.h"
SMSGSM sms;
CallGSM call;
char position;
char phone_number[20];
char sms_text[160];
boolean started=false;
byte stat=0;
LiquidCrystal_I2C lcd(0x20,16,2);
#define I2CADDR 0x24
const byte ROWS = 4;
const byte COLS = 4;
char hexaKeys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = {7, 6, 5, 4};
byte colPins[COLS] = {3, 2, 1, 0};
Keypad_I2C customKeypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS, I2CADDR);
char password[5] = "1234";
char tmpKey[10];
int tmpKeyIndex = 0;
boolean login, a, aa, b, bb, c, cc;
int temp;
String mess;
void setup()
{
lcd.init();
lcd.backlight();
pinMode(sensAA, INPUT);
digitalWrite(sensAA, LOW);
customKeypad.begin( );
//Serial.begin(9600); ----------------->qui ho decommentato
lcd.print(F("Starting system"));
if (gsm.begin(9600)){
lcd.setCursor(0,1);
lcd.print(F("GSM status:READY"));
started=true;
}else { lcd.setCursor(0,1);
lcd.print(F("GSM status:IDLE"));
}
delay(500);
lcd.clear();
};
void loop()
{
temp = analogRead(0);
temp = (5.0 * temp * 100.00) / 1024.0;
checkALARM();
if (!login) {lcd.setCursor(0,0);
lcd.print(F("Password:"));
lcd.setCursor(0,1);
lcd.print(mess);
lcd.print(F(" T:"));
lcd.print(temp);
lcd.print(F(" "));
}
char Key = customKeypad.getKey();
if (Key){
tmpKey[tmpKeyIndex] = Key;
lcd.setCursor((9+tmpKeyIndex),0);
tmpKeyIndex++;
lcd.print(Key);
if (String(Key)=="#") { lcd.setCursor(0,0);
lcd.print(F(" disconnesso"));
delay(500);
lcd.clear();
login = false;
tmpKeyIndex = 0;}
if (String(Key)=="*") {
if (checkPass() || login == true) {
lcd.setCursor(0,1);
lcd.print(F("comando: "));
checkCMD(String(tmpKey));
login = true; }
else {lcd.setCursor(0,1);
lcd.print(F(" Password errata"));
delay(500);
lcd.clear();
login = false; }
tmpKeyIndex = 0;
}
}
ora solo se premo il carattere # mi compaiono i caratteri strani