Created
April 21, 2016 15:38
-
-
Save MechanicalCoder/3bf207834348f7079e000afbf9c0f826 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "application.h" | |
unsigned int nextTime = 0; // Next time to contact the server | |
const int gasOutput = A0; | |
// int DangerLight = D7; | |
float MidConcThreshold = 650; | |
// float HighConcThreshold =1000; | |
float CurrentValue=0; | |
int i=0; | |
void setup() { | |
Serial.begin(9600); | |
// pinMode(DangerLight, OUTPUT); | |
} | |
void loop() { | |
CurrentValue = analogRead(gasOutput); | |
Serial.println("Keep Calm. no danger !"); | |
Spark.publish("Gas_Concentration",String(CurrentValue)); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A sample code on using spark.publish() method to send data to the cloud server. The cloud API URL and other credentials are mentioned in application.h file.