Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
karrku
/
Skeem_G2
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7f209ced
authored
Oct 04, 2022
by
karrku
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
251800be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
LihtneTMP36
LihtneTMP36
0 → 100644
View file @
7f209ced
/* TMP36 analog temperature sensor with Arduino example code. More info: https://www.makerguides.com */
// Define to which pin of the Arduino the output of the TMP36 is connected:
#define sensorPin A0
int serialpin = A0;
void setup() {
// Begin serial communication at a baud rate of 9600:
Serial.begin(9600);
}
void loop() {
// Get a reading from the temperature sensor:
int reading = analogRead(serialpin);
// Convert the reading into voltage:
float voltage = (reading * 5) / 1024;
// Convert the voltage into the temperature in Celsius:
float temperature = (voltage - 500)/10;
// Print the temperature in the Serial Monitor:
Serial.println(reading );
Serial.print(temperature);
Serial.print(" \xC2\xB0"); // shows degree symbol
Serial.println("C");
delay(1000); // wait a second between readings
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment