Commit 4b98fe22 authored by AlaskaLinuxUser's avatar AlaskaLinuxUser

Updated some screens and truth table info.

parent b177ba22
......@@ -73,6 +73,8 @@ uint8_t readline(char *buff, uint8_t maxbuff, uint16_t timeout = 0);
uint8_t type;
char imei[16] = {0}; // MUST use a 16 character buffer for IMEI!
bool GPSon = 0;
char messageText[141];
char sendText[21];
//*********************** Screen ******************
#include <PCD8544.h>
......@@ -346,11 +348,11 @@ void loop() {
screenNumber = 1;
break;
}
case 6:{
case 6:{ // Screen 2 - Location screen.
screenNumber = 5;
break;
}
case 12:{ // Screen 2 - Location screen. // TODO: make this work.
case 12:{
screenNumber = 2;
break;
}
......@@ -372,7 +374,7 @@ void loop() {
GPSon=0;
break;
}
case 32:{ // Screen 4 - Compass screen.// TODO: make this work.
case 32:{ // Screen 4 - Compass screen.
screenNumber = 1;
break;
}
......@@ -393,15 +395,15 @@ void loop() {
break;
}
case 42:{ // Screen 6 - Text/SMS screen.
screenNumber = 5;
screenNumber = 9;
break;
}
case 48:{
screenNumber = 2;
screenNumber = 7;
break;
}
case 54:{
screenNumber = 4;
screenNumber = 8;
break;
}
case 56:{ // Screen 7 - Type message screen. // TODO: make this work.
......@@ -417,18 +419,10 @@ void loop() {
break;
}
case 77:{
screenNumber = 5; // TODO: Add message.
break;
}
case 72:{ // Screen 8 - Delete ALL message screen.
screenNumber = 8;
break;
}
case 80:{
screenNumber = 8;
screenNumber = 1;
break;
}
case 88:{
case 88:{ // Screen 8 - Delete ALL message screen.
screenNumber = 6;
break;
}
......@@ -721,23 +715,6 @@ void checkSerialConn() {
Serial.println(gpsdata);
break;
/*
float latitude, longitude, speed_kph, heading, altitude, second;
uint16_t year;
uint8_t month, day, hour, minute;
if (fona.getGPS(&latitude, &longitude, &speed_kph, &heading, &altitude)) { // Use this line instead if you don't want UTC time
Serial.println(F("---------------------"));
Serial.print(F("Latitude: ")); Serial.println(latitude, 6);
Serial.print(F("Longitude: ")); Serial.println(longitude, 6);
Serial.print(F("Speed: ")); Serial.println(speed_kph);
Serial.print(F("Heading: ")); Serial.println(heading);
Serial.print(F("Altitude: ")); Serial.println(altitude);
// Comment out the stuff below if you don't care about UTC time
}
break; */
}
/*********************************** GPRS */
......@@ -835,51 +812,6 @@ void checkSerialConn() {
}
#endif
#if defined(SIMCOM_2G) || defined(SIMCOM_7000)
case 'P': {
// Post data to website via 2G or LTE CAT-M/NB-IoT
float temperature = analogRead(A0)*1.23; // Change this to suit your needs
// Voltage in mV, just for testing. Use the read battery function instead.
// Please note that for the LTE shield the voltage read will always be around 3.6V
// because the SIM7000 is powered by a 3.6V regulator. If you want to monitor the
// power source to the Arduino you will have to use something else.
uint16_t battLevel = 3600;
// Create char buffers for the floating point numbers for sprintf
// Make sure these buffers are long enough for your request URL
char URL[150];
char body[100];
char tempBuff[16];
char battLevelBuff[16];
// Format the floating point numbers as needed
dtostrf(temperature, 1, 2, tempBuff); // float_val, min_width, digits_after_decimal, char_buffer
dtostrf(battLevel, 1, 0, battLevelBuff);
// Construct the appropriate URL's and body, depending on request type
// Use IMEI as device ID for this example
// GET request
sprintf(URL, "dweet.io/dweet/for/%s?temp=%s&batt=%s", imei, tempBuff, battLevelBuff); // No need to specify http:// or https://
// sprintf(URL, "http://dweet.io/dweet/for/%s?temp=%s&batt=%s", imei, tempBuff, battLevelBuff); // But this works too
if (!fona.postData("GET", URL))
Serial.println(F("Failed"));
// POST request
/*
sprintf(URL, "http://dweet.io/dweet/for/%s", imei);
sprintf(body, "{\"temp\":%s,\"batt\":%s}", tempBuff, battLevelBuff);
if (!fona.postData("POST", URL, body)) // Can also add authorization token parameter!
Serial.println(F("Failed to complete HTTP POST..."));
*/
break;
}
#endif
/*****************************************/
case 'S': {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment