Created
March 23, 2018 07:15
-
-
Save e-Gizmo/472180df1c06dd67270485254507c324 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
/* | |
"GizDuino Starter kit" | |
Temperature sensor (LM35) Sample code | |
STEP 1: Construct the circuit of GizDuino Temperature sensor. | |
STEP 2: Connect the USB Cable to your computer. | |
STEP 3: Open the Arduino IDE. | |
STEP 4: Open the Temperature sensor (LM35) Sample code from GizDuino Starter kit code. | |
STEP 5: Then, click Upload. | |
This sample code is simply read the Sensor output. | |
*/ | |
float Temp; | |
int TempPin = 0; // | |
// the setting up of pins. | |
void setup() | |
{ | |
// initialize the digital pin as an output. | |
Serial.begin(9600); | |
} | |
// the loop is where your program runs repeatedly. | |
void loop() | |
{ | |
Temp = analogRead(TempPin); //read the analogpin | |
Temp = (Temp * 0.488)/10; //multiply by 0.488 for calibration and exact value of temperature. | |
Serial.print(Temp); // print the result open the serial monitor. | |
Serial.println(); | |
delay(1000); // 1 second delay. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment