STM32 F407VET6 SIM800C V2
Posted: Mon May 10, 2021 7:37 pm
Hi!
I have some problem with GSM SIM800C V2.
I don't know why but STM didn't send any data.
GSM work correctly (I check it using Arduino Duo. I call and everything works fine)
GPS and other stuff works fine.
Maybe some one can help me?
Core https://github.com/stm32duino/wiki/wiki/Getting-Started
The callnumber() function works fine.
I tested them on an Arduino Uno
The code I use.
I have some problem with GSM SIM800C V2.
I don't know why but STM didn't send any data.
GSM work correctly (I check it using Arduino Duo. I call and everything works fine)
GPS and other stuff works fine.
Maybe some one can help me?
Core https://github.com/stm32duino/wiki/wiki/Getting-Started
The callnumber() function works fine.
I tested them on an Arduino Uno
The code I use.
Code: Select all
/*
Board pinout what I use
https://os.mbed.com/media/uploads/hudakz/stm32f407vet6_right01.png
https://os.mbed.com/media/uploads/hudakz/stm32f407vet6_left02.png
https://os.mbed.com/media/uploads/hudakz/stm32f407vet6_st-link03.png
I found Original Schematic STM32F407VET6
https://stm32-base.org/assets/pdf/boards/original-schematic-STM32F407VET6-STM32_F4VE_V2.0.pdf
*/
//===========================|Library Block|==============================//
#include "Adafruit_GFX.h" // Graphics processing library
#include "Adafruit_ILI9341.h" // Software drivers for ILI9341 displays
#include "Adafruit_Sensor.h" // Adafruit unified sensor library, which provides a common 'type' for sensor data.
#include "Adafruit_BME280.h" // Adafruit library for BME280 sensor
#include "TinyGPS++.h" // Arduino library for parsing NMEA data streams provided by GPS modules.
#include "QMC5883LCompass.h" // Arduino library for QMC5883L sensor
#include "SoftwareSerial.h" //This library allow serial communication on other digital pins, using software to replicate the functionality
#include "Wire.h" //This library allows you to communicate with I2C / TWI devices.
#include "SPI.h" //This library allows communicate with SPI devices, with the Arduino as the master device.
#include "Keypad.h" // Library for using matrix style keypads with the Arduino
//===========================|QMC5883L Block|==============================//
QMC5883LCompass compass; // I2C
int a = 0; //Azimuth
int b = 0; //Bearing
char myArray[3] = {0, 0, 0}; // Char Direction - N E W S
//For screen overwrite
int oldAzimuth = 0;
int oldBearing = 0;
char oldMyArray[3] = {0, 0, 0};
//===========================|BME280 Block|==============================//
#define SEALEVELPRESSURE_HPA (1015.92)
Adafruit_BME280 bme; // I2C
int Temperature = 0;
int Pressure = 0;
int Altitude = 0;
int Humidity = 0;
//For screen overwrite
int oldTemperature = 0;
int oldPressure = 0;
int oldAltitude = 0;
int oldHumidity = 0;
//===========================|TFT LCD Block|==============================//
#define TFT_DC PD5 // D/C display output connection pin
#define TFT_CS PD7 // CS display pin connection pin
#define TFT_RST -1 // RESET
//#define TFT_RST PA3 - RESE connection pin if use button res
#define TFT_MISO PB14 // SDO display output connection pin (MISO)
#define TFT_MOSI PB15 // SDI display output connection pin (MOSI)
#define TFT_CLK PB13 // SCK display output connection pin
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
//===========================|GPS NEO 7 M Block|==============================//
static const int GPS_RX = PA7, GPS_TX = PA6; // Soft serial connection pins
static const uint32_t GPSBaud = 9600; // Data transfer rate in bit / s (baud)
TinyGPSPlus gps;// The TinyGPS++ object
SoftwareSerial ss(GPS_RX, GPS_TX); // The serial connection to the GPS device
float locLAT = 0; // Latitude
float locLNG = 0; //Long
int dateMONTH = 0;
int dateDAY = 0;
int dateYEAR = 0;
int timeHOUR = 0;
int timeMINUTE = 0;
int timeSECOND = 0;
bool errL = false; //Location Error
bool errD = false; //Data Error
bool errT = false; //Time Error
//===========================|GSM SIM800C V2 Block|==============================//
static const int GSM_RX = PA10, GSM_TX = PA9; // Soft serial connection pins
static const uint32_t GSMBaud = 9600; // Data transfer rate in bit / s (baud)
SoftwareSerial SIM800(GSM_RX, GSM_TX); // The serial connection to the GSM device
int _timeout;
String _buffer; // For save and read from Serial (for test Arduino)
String number = "+380935239435";
String SMS = "Test measage";
//===========================|Keypad Block|==============================//
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {PE7, PE8, PE9, PE10}; //Connect to the row pinouts of the keypad
byte colPins[COLS] = {PE11, PE12, PE13, PE14}; //Connect to the column pinouts of the keypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); //Initialize an instance of class NewKeypad
//===========================|MENU Block|==============================//
static bool initialized; //Menu Loading Flag
//Visibility Section
int seeFuncMenu = 0; // 1 - BME280, 2 - QMC, 3 - GPS, 4 - GSM
int butState = 0; // 0 - MainMenu 1 - A Menu, 2 - B Menu, 3 - C Menu, 4 - D Menu
bool button = true; // Ture/False - Unclicked/Clicked
//===========================|SETUP Block|==============================//
void setup()
{
//Initiates a serial connection and sets the data transfer rate in bit / s (baud)
Serial.begin(9600);
//GSM
_buffer.reserve(50);
SIM800.begin(GSMBaud); //Initialize GSM
SIM800.println("AT");
//GPS
ss.begin(GPSBaud); //Initialize GPS
//BME280
bme.begin(0x76); //Initialize BME280
//QMC
Wire.begin(); //Initialize
compass.setCalibration(-680, 1625, -1890, 1928, -4123, 0); // Calibration data
compass.init(); //Initialize QMC
//Logo
tft.begin(); //Initialize TFT
tft.setRotation(0); //Screen rotation
tft.fillScreen(0x0101); //The fillScreen function changes the screen color to 0x0101
tft.fillRect(0, 0, 240, 25, ILI9341_RED); //The fillRect function draws a filled rectangle
tft.setTextColor(ILI9341_WHITE); //Sets the color of the text
tft.setTextSize(2); //Set the text size
tft.setCursor(72, 5); //Set the cursor position
tft.print("Testing"); //Write something on screen
tft.setTextColor(ILI9341_BLACK);
tft.setTextSize(2);
//tft.fillRoundRect(10, 50, 220, 50, 4 , ILI9341_YELLOW);
tft.fillRoundRect(10, 50, 220, 230, 4 , ILI9341_YELLOW);
tft.setCursor(20, 120);
tft.print("My Course Project");
tft.setTextColor(ILI9341_GREEN);
tft.fillRoundRect(0, 300, 240, 30, 10 , ILI9341_ORANGE);
tft.setCursor(100, 301);
tft.print("STM");
//Keypad
customKeypad.setHoldTime(500);
customKeypad.setDebounceTime(250);
delay(2000);
}
//===========================|LOOP Block|==============================//
void loop()
{
if (!initialized)
{
initialized = true;
drawMenu();
}
char customKey = customKeypad.getKey(); // What button we press
//If we are in some Menu
if (seeFuncMenu == 1)
{
funcBME280();
}
else if (seeFuncMenu == 2)
{
funcQMC5883L();
}
else if (seeFuncMenu == 3)
{
//gps.encode(ss.read());
//funcGPSNEO7M();
while (ss.available() > 0)
if (gps.encode(ss.read()))
funcGPSNEO7M();
if (millis() > 5000 && gps.charsProcessed() < 10)
{
tft.setTextColor(ILI9341_RED);
tft.setTextSize(1);
tft.setCursor(10, 35);
tft.print(F("GPS NEO-7M"));
tft.setCursor(10, 55);
tft.print(F("No GPS detected: check wiring."));
//while (true);
}
}
else if (seeFuncMenu == 4)
{
}
//Menu chose
switch (customKey)
{
case 'A':
menuBME280();
break;
case 'B':
if ( butState == 1)
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("BME280 - SubMenu 1");
seeFuncMenu = 0;
}
else if ( butState == 2)
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("QMC - SubMenu 1");
seeFuncMenu = 0;
}
else if ( butState == 3)
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("GPS - SubMenu 1");
seeFuncMenu = 0;
} else if ( butState == 4)
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("GSM - SubMenu 1");
seeFuncMenu = 0;
} else
{
menuQMC();
}
break;
case 'C':
if ( butState == 1)
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("BME280 - SubMenu 2");
seeFuncMenu = 0;
}
else if ( butState == 2)
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("QMC - SubMenu 2");
seeFuncMenu = 0;
}
else if ( butState == 3)
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("GPS - SubMenu 2");
seeFuncMenu = 0;
}
else if ( butState == 4)
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("GSM - SubMenu 2");
seeFuncMenu = 0;
}
else
{
menuGPSNEO7M();
}
break;
case 'D':
if ( butState == 1)
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("BME280 - SubMenu 3");
seeFuncMenu = 0;
}
else if ( butState == 2)
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("QMC - SubMenu 3");
seeFuncMenu = 0;
}
else if ( butState == 3)
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("GPS - SubMenu 3");
seeFuncMenu = 0;
} else if ( butState == 4)
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("GSM - SubMenu 3");
seeFuncMenu = 0;
} else
{
menuGSM();
}
break;
}
delay(1);
}
//======================================================================================//
//===========================|Menu BME280 Block|=======================================//
//====================================================================================//
void menuBME280()
{
if (button)
{
//if we press A button first time
tft.fillRect(0, 30, 240, 262, 0x0101);
seeFuncMenu = 1;
button = false;
butState = 1;
}
else if (!button)
{
// if we press A button second time
seeFuncMenu = 0;
drawMenu();
button = true;
butState = 0;
}
}
//======================================================================================//
//===========================|Menu QMC5883L Block|=====================================//
//====================================================================================//
void menuQMC()
{
if (button)
{
//if we press B button first time
tft.fillRect(0, 30, 240, 262, 0x0101);
seeFuncMenu = 2;
button = false;
butState = 2;
}
}
//======================================================================================//
//===========================|Menu GPS NEO 7 M Block|==================================//
//====================================================================================//
void menuGPSNEO7M()
{
if (button)
{
//if we press C button first time
tft.fillRect(0, 30, 240, 262, 0x0101);
seeFuncMenu = 3;
button = false;
butState = 3;
}
}
//======================================================================================//
//===========================|Menu GSM SIM800C V2 Block|===============================//
//====================================================================================//
void menuGSM()
{
if (button)
{
//if we press D button first time
tft.fillRect(0, 30, 240, 262, 0x0101);
callNumber();
seeFuncMenu = 4;
button = false;
butState = 4;
}
}
//======================================================================================//
//===========================|Function BME280 Block|===================================//
//====================================================================================//
void funcBME280()
{
oldTemperature = Temperature;
oldPressure = Pressure;
oldAltitude = Altitude;
oldHumidity = Humidity;
Temperature = bme.readTemperature();
Pressure = bme.readPressure() / 100;
Altitude = bme.readAltitude(SEALEVELPRESSURE_HPA);
Humidity = bme.readHumidity();
if (seeFuncMenu = 1)
{
tft.setTextColor(ILI9341_RED, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("BME280");
tft.setCursor(10, 70);
tft.print("Temperature:");
if (Temperature != oldTemperature)
{
tft.fillRect(150, 70, 100, 14, 0x0101);
}
tft.setCursor(150, 70);
tft.print(Temperature);
tft.setCursor(10, 100);
tft.print("Pressure:");
if (Pressure != oldPressure)
{
tft.fillRect(150, 100, 100, 14, 0x0101);
}
tft.setCursor(150, 100);
tft.print(Pressure);
tft.setCursor(10, 130);
tft.print("Altitude:");
if (Altitude != oldAltitude)
{
tft.fillRect(150, 130, 100, 14, 0x0101);
}
tft.setCursor(150, 130);
tft.print(Altitude);
tft.setCursor(10, 160);
tft.print("Humidity:");
if (Humidity != oldHumidity)
{
tft.fillRect(150, 160, 100, 14, 0x0101);
}
tft.setCursor(150, 160);
tft.print(Humidity);
}
}
//======================================================================================//
//===========================|Function QMC5883L Block|=================================//
//====================================================================================//
void funcQMC5883L()
{
oldAzimuth = a;
oldBearing = b;
oldMyArray[1] = myArray[1];
oldMyArray[2] = myArray[2];
oldMyArray[3] = myArray[3];
compass.read(); //Get data from compass
a = compass.getAzimuth(); //Read azimuth
b = compass.getBearing(a); //Read Bearing (sent azimuth)
compass.getDirection(myArray, a); //Read direction (write on array, sent azimuth)
if (seeFuncMenu = 2)
{
tft.setTextColor(ILI9341_GREEN, 0x0101);
tft.setTextSize(2);
tft.setCursor(10, 40);
tft.print("QMC");
tft.setCursor(10, 70);
tft.print("Azimuth:");
if (oldAzimuth != a)
{
tft.fillRect(150, 70, 100, 14, 0x0101);
}
tft.setCursor(150, 70);
tft.print(a);
tft.setCursor(10, 100);
tft.print("Bearing:");
if (oldBearing != b)
{
tft.fillRect(150, 100, 100, 14, 0x0101);
}
tft.setCursor(150, 100);
tft.print(b);
tft.setCursor(10, 130);
tft.print("Direction:");
if ( oldMyArray[1] != myArray[1] || oldMyArray[2] != myArray[2] || oldMyArray[3] != myArray[3] )
{
tft.fillRect(150, 130, 100, 14, 0x0101);
}
tft.setCursor(150, 130);
tft.write(myArray);
tft.setCursor(10, 220);
tft.fillTriangle(120, 160, 60, 290, 180, 290, ILI9341_GREEN); //Print triangle
}
}
//======================================================================================//
//===========================|Function GPS NEO 7 M Block|==============================//
//====================================================================================//
void funcGPSNEO7M()
{
locLAT = gps.location.lat();
locLNG = gps.location.lng();
dateMONTH = gps.date.month();
dateDAY = gps.date.day();
dateYEAR = gps.date.year();
timeHOUR = gps.time.hour();
timeMINUTE = gps.time.minute();
timeSECOND = gps.time.second();
if (seeFuncMenu = 3)
{
//Menu GPS
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(1);
tft.setCursor(10, 35);
tft.print("GPS NEO-7M");
tft.setCursor(10, 45);
tft.print("LOCATION");
tft.setCursor(10, 65);
tft.print("DATE");
tft.setCursor(10, 85);
tft.print("TIME UTC");
}
//Location LAT - LNG
if (gps.location.isValid())
{
if (errL)
{
if (seeFuncMenu = 3)
{
tft.fillRect(10, 55, 260, 7, 0x0101);
}
}
if (seeFuncMenu = 3)
{
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(1);
tft.setCursor(10, 55);
tft.print("LAT: ");
tft.fillRect(35, 55, 60, 7, 0x0101);
tft.setCursor(35, 55);
tft.print(locLAT);
tft.setCursor(145, 55);
tft.print("LGN: ");
tft.fillRect(170, 55, 60, 7, 0x0101);
tft.setCursor(170, 55);
tft.print(locLNG);
}
}
else
{
errL = true;
if (seeFuncMenu = 3)
{
tft.fillRect(10, 55, 260, 7, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(1);
tft.setCursor(10, 55);
tft.print("INVALID LOCATION");
}
}
//DATE
if (gps.date.isValid())
{
if (errD)
{
if (seeFuncMenu = 3)
{
tft.fillRect(10, 75, 260, 7, 0x0101);
}
}
if (seeFuncMenu = 3)
{
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(1);
tft.setCursor(10, 75);
tft.print("Month/Day/Year:");
tft.setCursor(105, 75);
tft.print(dateMONTH);
tft.setCursor(110, 75);
tft.print("/");
tft.setCursor(115, 75);
tft.print(dateDAY);
tft.setCursor(120, 75);
tft.print("/");
tft.setCursor(125, 75);
tft.print(dateYEAR);
}
}
else
{
errD = true;
if (seeFuncMenu = 3)
{
tft.fillRect(10, 75, 260, 7, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(1);
tft.setCursor(10, 75);
tft.print("INVALID DATE");
}
}
//TIME
if (gps.time.isValid())
{
if (errT)
{
if (seeFuncMenu = 3)
{
tft.fillRect(10, 95, 260, 7, 0x0101);
}
}
if (timeHOUR < 10)
{
if (seeFuncMenu = 3)
{
tft.fillRect(10, 95, 25, 7, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(1);
tft.setCursor(10, 95);
tft.print("0");
tft.setCursor(16, 95);
tft.print(timeHOUR);
}
}
else
{
if (seeFuncMenu = 3)
{
tft.fillRect(10, 95, 25, 7, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(1);
tft.setCursor(10, 95);
tft.print(timeHOUR);
}
}
if (timeMINUTE < 10)
{
if (seeFuncMenu = 3)
{
tft.fillRect(25, 95, 25, 7, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(1);
tft.setCursor(25, 95);
tft.print("0");
tft.setCursor(31, 95);
tft.print(timeMINUTE);
}
}
else
{
if (seeFuncMenu = 3)
{
tft.fillRect(25, 95, 25, 7, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(1);
tft.setCursor(25, 95);
tft.print(timeMINUTE);
}
}
if (timeSECOND < 10)
{
if (seeFuncMenu = 3)
{
tft.fillRect(40, 95, 25, 7, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(1);
tft.setCursor(40, 95);
tft.print("0");
tft.setCursor(46, 95);
tft.print(timeSECOND);
}
}
else
{
if (seeFuncMenu = 3)
{
tft.fillRect(40, 95, 25, 7, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(1);
tft.setCursor(40, 95);
tft.print(timeSECOND);
}
}
}
else
{
errT = true;
if (seeFuncMenu = 3)
{
tft.fillRect(10, 95, 260, 7, 0x0101);
tft.setTextColor(ILI9341_WHITE, 0x0101);
tft.setTextSize(1);
tft.setCursor(10, 95);
tft.print("INVALID TIME");
}
}
}
//======================================================================================//
//===========================|Function GSM SIM800C V2 Block|===========================//
//====================================================================================//
void SendMessage()
{
SIM800.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(200);
SIM800.println("AT+CMGS=\"" + number + "\"\r"); //Mobile phone number to send message
delay(200);
SIM800.println(SMS);
delay(100);
SIM800.println((char)26);// ASCII code of CTRL+Z
delay(200);
_buffer = _readSerial();
}
void RecieveMessage()
{
if (seeFuncMenu = 5)
{
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 45);
tft.println("SIM800C Read an SMS");
tft.setTextSize(1);
SIM800.println("AT+CMGF=1");
delay (200);
SIM800.println("AT+CNMI=1,2,0,0,0"); // AT Command to receive a live SMS
delay(200);
tft.println("Unread Message done");
//Serial.write ("Unread Message done");
}
}
void callNumber()
{
if (seeFuncMenu = 4)
{
SIM800.print (F("ATD"));
SIM800.print (number);
SIM800.print (F(";\r\n"));
//SIM800.print("ATD+380935239435;");
_buffer = _readSerial();
tft.setTextColor(ILI9341_RED);
tft.setTextSize(2);
tft.setCursor(30, 100);
tft.print(_buffer);
}
}
String _readSerial()
{
_timeout = 0;
while (!SIM800.available() && _timeout < 1000 )
{
delay(13);
_timeout++;
}
if (SIM800.available()) {
return SIM800.readString();
}
}
void drawMenu()
{
tft.fillRect(0, 30, 240, 262, 0x0101);
tft.setTextColor(ILI9341_BLACK);
tft.setTextSize(3);
tft.fillRoundRect(10, 50, 220, 50, 6 , ILI9341_YELLOW);
tft.setCursor(97, 63);
tft.print("BME");
tft.fillRoundRect(10, 110, 220, 50, 6 , ILI9341_YELLOW);
tft.setCursor(97, 123);
tft.print("QMC");
tft.fillRoundRect(10, 170, 220, 50, 6 , ILI9341_YELLOW);
tft.setCursor(97, 183);
tft.print("GPS");
tft.fillRoundRect(10, 230, 220, 50, 6 , ILI9341_YELLOW);
tft.setCursor(97, 243);
tft.print("GSM");
}
/*
#define PERIOD1 1000
uint32_t timer1 = 0;
if (millis() - timer1 >= PERIOD1)
{
somefunc();
do
{
timer1 += PERIOD1;
if (timer1 < PERIOD1) break;
}
while (timer1 < millis() - PERIOD1);
}
*/
/*
while (ss.available() > 0)
if (gps.encode(ss.read()))
funcGPSNEO7M();
if (millis() > 5000 && gps.charsProcessed() < 10)
{
tft.setTextColor(ILI9341_RED);
tft.setTextSize(1);
tft.setCursor(10, 35);
tft.print(F("GPS NEO-7M"));
tft.setCursor(10, 55);
tft.print(F("No GPS detected: check wiring."));
while (true);
}
if (SIM800.available() > 0)
Serial.write(SIM800.read());
*/
/*
if (customKey)
{
//char waitForKey();
if (customKey == 'A')
{
//SendMessage();
tft.fillRect(0, 30, 240, 260, 0x0000);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 45);
tft.print("SendMessage");
}
if (customKey == 'B')
{
//RecieveMessage();
tft.fillRect(0, 30, 240, 260, 0x0000);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 45);
tft.print("RecieveMessage");
}
if (customKey == 'C')
{
//callNumber();
tft.fillRect(0, 30, 240, 260, 0x0000);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 45);
tft.print("callNumber");
}
}
*/