Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BHA_Incubator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
biohack
BHA_Incubator
Commits
269fb31b
Commit
269fb31b
authored
9 years ago
by
PieterVanBoheemen
Browse files
Options
Downloads
Patches
Plain Diff
Clear distinction between Digital and Analog temp sensor code
parent
03ea12a8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Arduino Code/Incubator/Incubator.ino
+16
-3
16 additions, 3 deletions
Arduino Code/Incubator/Incubator.ino
with
16 additions
and
3 deletions
Arduino Code/Incubator/Incubator.ino
+
16
−
3
View file @
269fb31b
...
...
@@ -18,6 +18,12 @@
<http://www.gnu.org/licenses/>.
*/
/* PLEASE NOTE
* By default this code assume you will use an analog temperature sensor
* (10K Thermistor). In case you are using an 1-wire digital sensor you
* will have to uncomment a section in the Loop() function
*/
/* Attribution
...
...
@@ -136,10 +142,17 @@ double Thermister(int RawADC) { //Function to perform the fancy math of the Ste
void
loop
()
{
if
((
millis
()
-
begin_temp_time
)
>
temp_time
)
{
float
temperature
=
getTemp
();
val
=
analogRead
(
0
);
//Read the analog port 0 and store the value in val
/* UNCOMMENT THESE LINES IN CASE YOU ARE USING A DIGITAL TEMP SENSOR */
// float temperature = getTemp(); // Read temperature via digital sensor
// temp=temperature;
/* UNCOMMENT UNTIL HERE */
/* THESE LINES ARE USED WHEN AN ANALOG TEMP SENSOR IS IN USE */
val
=
analogRead
(
analogTempPin
);
//Read the analog port 0 and store the value in val
temp
=
Thermister
(
val
);
//Runs the fancy math on the raw analog value
temp
=
temperature
;
/* END ANALOG SENSOR */
Serial
.
println
(
temp
);
//Print the value to the serial port
begin_temp_time
=
millis
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment