Skip to content

Instantly share code, notes, and snippets.

@sachendra003
Last active July 4, 2019 08:47
Show Gist options
  • Save sachendra003/7b93705b5c5d3dfd3621d26b988e507a to your computer and use it in GitHub Desktop.
Save sachendra003/7b93705b5c5d3dfd3621d26b988e507a to your computer and use it in GitHub Desktop.
Temperature Monitoring on Smartphone
#include <Adafruit_Sensor.h>
/*
1. Go to sketch
2. Go to Manage Libraries
3. Install Adafruit unified sensor
4. Add that Adafruit unified sensor file
*/
int i = 0;
float temp = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
i = analogRead(A0); // analog pin A0
temp = (i/1024.0)*500;
Serial.println(temp);
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment