Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
brevsae authored Oct 10, 2018
2 parents 50f117e + 2351958 commit 6c8e9f1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions DHTtester-sae/DHTtester-sae.ino
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain
//Original version written by ladyada to the public domain

#include "DHT.h"

#define DHTPIN 2 // what digital pin we're connected to

#define tempSen 4
// Uncomment whatever type you're using!
#define DHTTYPE11 DHT11 // DHT 11
Expand All @@ -25,6 +25,7 @@ DHT dht(DHTPIN, DHTTYPE11);
DHT dhte(tempSen, DHTTYPE);
int PKILL = 5;
float TEMPLIMIT = 30.0;

void setup() {
Serial.begin(9600);
Serial.println("Formula SAE promises no cell will reach 1000000 C!");
Expand All @@ -37,6 +38,7 @@ void setup() {
void loop() {
// Wait a few seconds between measurements.
delay(2000);

/**///Print out left (non-Emanuel first)!
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
Expand All @@ -45,16 +47,14 @@ void loop() {
float tleft = dht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
float fleft = dht.readTemperature(true);


if (tleft > TEMPLIMIT){
Serial.println("SHUTTING DOWN");
return PKILL;
}
// Check if any reads failed and exit early (to try again).
if (isnan(hleft) || isnan(tleft) || isnan(fleft)) {
Serial.println("Failed to read from DHTPIN sensor!");
return;
//return;
}

// Compute heat index in Fahrenheit (the default)
Expand All @@ -76,7 +76,7 @@ void loop() {
Serial.print(hifleft);
Serial.println(" *F");


/**/
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
Expand All @@ -85,7 +85,7 @@ void loop() {
float t = dhte.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
float f = dhte.readTemperature(true);

if (t > TEMPLIMIT){
Serial.println("SHUTTING DOWN");
return PKILL;
Expand Down Expand Up @@ -114,4 +114,4 @@ void loop() {
Serial.print(" *C ");
Serial.print(hif);
Serial.println(" *F");
}
}

0 comments on commit 6c8e9f1

Please sign in to comment.