From 3b38242554d5436a288c0ca671be202f0aef3b74 Mon Sep 17 00:00:00 2001 From: 0x6f736f646f Date: Fri, 28 Aug 2020 01:06:43 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Spacing=20the=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hardware/harwareapp/harwareapp.ino | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Hardware/harwareapp/harwareapp.ino b/Hardware/harwareapp/harwareapp.ino index 35e0940..dca332f 100644 --- a/Hardware/harwareapp/harwareapp.ino +++ b/Hardware/harwareapp/harwareapp.ino @@ -51,19 +51,18 @@ const int ldrPin = PB0; #define relayPin PA7 // Your GPRS credentials, if any -const char apn[] = "iot.safaricom.com"; +const char apn[] = SAF_APN; const char gprsUser[] = ""; const char gprsPass[] = ""; // Buffer to stop messages when formating before publishing or printing char buffer[100]; // Default return code int returnCode = 0; -// BEGIN MQTT CONFIG -const char mqttUsername[] = "rodneyeris:demo2eris"; -const char mqttPassword[] = "qwertyuiop123"; -const char mqttDeviceID[] = "rodneylocalhost2"; -#define TOPIC_PREFIX "rodneyeris/demo2eris/" +// BEGIN MQTT CONFIG +const char mqttUsername[] = MQTT_CREDENTIALS; +const char mqttPassword[] = DEVICE_GROUP_PASSWORD; +const char mqttDeviceID[] = DEVICE_ID; // birth topic - This is a topic that the device publishes to when it makes the first MQTT Connection // will topic - This is a topic that the device should publish to when it disconnects. @@ -79,9 +78,10 @@ const char *lightIntensityTopic = TOPIC_PREFIX "light"; const char birthMessage[] = "CONNECTED"; const char willMessage[] = "DISCONNECTED"; -char brokerAddress[] = "broker.africastalking.com"; -int brokerPort = 1883; - +char brokerAddress[] = BROKER_ADDRESS; +int brokerPort = BROKER_PORT; +// END MQTT CONFIG +// Variables to store sensor values before publishing to the broker float humidity, temperature, soilMoistureValue, ldrValue; // iterator variable int r; @@ -109,12 +109,12 @@ void sendSoilMoisture(void); void sendLightIntensity(void); void incomingMessageHandler(MQTT::MessageData &messageData); void pre(void); +void print_on_oled(char* topic, float data); void setup() { // Start the OLED display u8x8.begin(); - // Start serial monitors u8x8.setPowerSave(0); // Start serial monitors SerialMon.begin(115200);