Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
kalili
/
SkeemitehnikaG1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
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
47044e74
authored
Oct 05, 2022
by
hamara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parents
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
TMP36
TMP36
0 → 100644
View file @
47044e74
#define aref_voltage 3.3
int tempPin = A1;
int tempReading;
void setup(void) {
Serial.begin(9600);
analogReference(EXTERNAL);
}
void loop(void) {
tempReading = analogRead(tempPin);
Serial.print("Temp reading = ");
Serial.print(tempReading);
float voltage = tempReading * aref_voltage;
voltage /= 1024.0;
Serial.print(" - ");
Serial.print(voltage); Serial.println(" volts");
float temperatureC = (voltage - 0.5) * 100 ;
degrees ((volatge - 500mV) times 100)
Serial.print(temperatureC); Serial.println(" degrees C");
delay(1000);
}
\ 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