Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: GPSLibrary GSM mbed-modifed Storage_Library Temp_Library Wakeup pH_Sensor
main.h
00001 #include "mbed.h" 00002 00003 #define URL "" //URL -- Required 00004 #define NETWORK_APN "fast.tmobile.com" //APN URL 00005 00006 #define N_READINGS_PER_SEND 5 // Readings to take before sending 00007 #define N_SECONDS_SLEEP 360 // Seconds between readings 00008 00009 // Temperature sensor constant 00010 #define TMP_ANALOG A0 // Analog communication for temperature sensor 00011 00012 // Global Positioning System constants 00013 #define GPS_TX D6 // Denotes TX port on the Nucleo, attached to RX port on GPS 00014 #define GPS_RX PB_11 // Likewise, TX port on GPS, RX on Nucleo 00015 #define GPS_EN D7 // Enable pin for power on/off. Connected to a digital pin 00016 00017 // pH sensor constants 00018 #define PH_TX PC_10 // Serial communication for pH 00019 #define PH_RX PC_11 // Serial communication for pH 00020 00021 // Cellular communication constants 00022 #define FONA_TX D8 // Serial communication for GSM 00023 #define FONA_RX D2 // Serial communication for GSM 00024 #define FONA_RST D3 // Required for ported Adafruit Library 00025 #define FONA_RI D4 // "Ring Indicator" to recieve calls 00026 #define FONA_KEY D5 // Turns FONA off/on (pull to GRND for 2 seconds to change state) 00027 00028 #define SIZE_OF_ENTRY (45+5*sizeof(int)) // Size of each entry when converted to a string in main.cpp:send(); 00029 00030 #ifndef _MAIN_H 00031 #define _MAIN_H 00032 // Reading struct that includes the data for each reading we take 00033 struct reading { 00034 float temperature; 00035 float pH; 00036 float latitude; //Signed positive if N, negative if S 00037 float longitude; //Signed positive if E, negative if W 00038 uint8_t day; 00039 uint8_t month; 00040 uint8_t year; 00041 uint8_t hour; 00042 uint8_t minutes; 00043 }; 00044 #endif
Generated on Wed Jul 13 2022 03:01:23 by
1.7.2