How to Display the Temperature readings?

Yup, Particle has made sure that all global variables are initialised with zero valuse, so for boolean the default is false, but sure enough explicit initialisation is good practice :+1:

But there is another problem with this bDHTstarted. It should only be reset to false inside the if (!DHT.acquiring()) { ... } block, but it's done outside of it.
The same is true for DHTnextSampleTime.

It may well do, but it definetly makes your code not work as expected

Well, I got most of this from examples, so I didn’t do some of this
(I don’t need Particle publish any more if I can get blynk to work)

That doesn't change a thing. I'd guess you sprinkled your curly braces not exactly the way they were in the original code and that does make or break your code.

@csh13, You can always test the examples on their own. However, when you combine examples together and add your own code, then it all has to be put together carefully. With experience you will learn why the libraries and examples are done the way they are. Sometimes the example fits your needs; sometimes your needs are different. Keep learning and working on coding; you will soon be doing it on your own.

Thinking of learning, thanks @ScruffR for the tip on default values. I just learned something.

/src/blynk.cpp:29:19: fatal error: blynk.h: No such file or directory
 #include "blynk.h"

I didn’t do anything to the example, pressed the verify button and this came up.

The examples have the example files, but there is more than just that. It is necessary to fully setup your project.
The example depends on two libraries; one of these libraries is mentioned in your error message: Blynk.
The error message clearly indicates that the Blynk.h file could not be found. Therefore, you have to do something so the file can be found.

What I would do is ensure you are using the Blynk library correctly.
First, remove any blynk.cpp and blynk.h files from your project.
Second, go over the instructions on using libraries in the documentation here.
Third, add the Blynk library to your project following the instructions.
Fourth, once you are done, you can double-check your project.properties file. It should look something like this (I named my project Test; yours might be different)

name=Test
dependencies.blynk=0.4.5
dependencies.PietteTech_DHT=0.0.5

If it looks different, then go back, check the details and keep working on it.

Give that a try. Once that is fixed, we can move onto any other errors.

Even though it says
#include <blynk>
at the top, apparently doesn’t mean you have it in your project. you have to manually press the include in project button to make it work. the automatic version from the example needs it.

I can write

#include <blynk.h>

in this post, that does - not apparently but definetly - not mean that library is now included in this post.
The same is the case with your source file - it's only text.

And for that exact reason @cyclin_al gave you a link to the docs

https://docs.particle.io/guide/getting-started/build/photon/#using-libraries

yes but it seemed that would be alright because it was already in the example

I learned something today guys thank you so much for all you efforts!!!:smile:

If you use a bundled example via the USE THIS EXAMPLE button, the library already gets imported automatically, hence that code is OK in the sample, but that's not the case for private projects hence different rules apply.

OK the explains it, i was just copy/pasting

Is there anything wrong with this?

if (temp < minTemp)
{
	if (heatOn == false)
	{
		digitalWrite(D0,HIGH);
		heatOn = true;
		Blynk.virtualWrite(V0, HIGH);
		lcd.clear();
		lcd.print(0,0,"Turning on");
	}
}
else
{
	
}
if (temp > maxTemp)
{
	if (heatOn == true)
	{
		digitalWrite(D0,LOW);
		heatOn = false;
		Blynk.virtualWrite(V0, LOW);
		lcd.clear();
		lcd.print(0,0,"Turning off");
	}
}
else
{
	
}
if (DHTA.getFahrenheit() > 199)
{
	if (heatOn ==true)
	{
		digitalWrite(D0,LOW);
		heatOn = false;
		lcd.clear();
		lcd.print(0,0, "OverHeat Emer-");
		lcd.print(0,1, "gency Shutoff!!");
		delay(600000);
		
	}
}
else
{
	lcd.clear();
	lcd.print(0,1,"All parts working");
}

Is it doing something else than you’re expecting? We really don’t want to go look for errors without knowing what to look for…

i just didnt seem to be working and my heater relay (D0) didn’t flip on when it should have

What have you tried to debug so far?

Now its flipping off at random times (kinda acts like it automatically hits the reset button but takes longer to get back online). Would you like me to post my code?

Loops that are to large and external power problems.
Am I using the ifs and bools correctly?

My relay will only click on when I have it connected to some sort of ground.
Is that regular?

Posting your code, and a detailed description and/or images of how you wired everything would be helpful.

What, do you say you haven't got a common ground for the controller and your relay's signal stage?

In that case, in addition to your code you need to provide a wiring schema too.

yes i do

/*
Attach D4 to Heater relay,
Attach sensor inputs Top to D3 and bottom to D2,
Attach V1 to the minimum slider,
Attach V2 to the maximum slider,
Temperture top comes out of V5,
Temperture bottom comes out of V10.









*/
// This #include statement was automatically added by the Particle IDE.
#include <blynk.h>

char auth[] = "23e459b94bfe4ebc8b3669ef795c121e";

#define BLYNK_PRINT Serial

// This #include statement was automatically added by the Particle IDE.
#include <PietteTech_DHT.h>

/*
 * FILE:        DHT_2sensor.cpp
 * VERSION:     0.4
 * PURPOSE:     Example that uses DHT library with two sensors
 * LICENSE:     GPL v3 (http://www.gnu.org/licenses/gpl.html)
 *
 * Calls acquire on two sensors and monitors the results for long term
 * analysis.  It uses DHT.acquire and DHT.acquiring
 * Also keeps track of the time to complete the acquire and tracks errors
 *
 * Scott Piette (Piette Technologies) scott.piette@gmail.com
 *      January 2014        Original Spark Port
 *      October 2014        Added support for DHT21/22 sensors
 *                          Improved timing, moved FP math out of ISR
 *      September 2016      Updated for Particle and removed dependency
 *                          on callback_wrapper.  Use of callback_wrapper
 *                          is still for backward compatibility but not used
 * ScruffR
 *      February 2017       Migrated for Libraries 2.0
 *                          Fixed blocking acquireAndWait()
 *                          and previously ignored timeout setting
 *                          Added timeout when waiting for Serial input
 *                          Fixed possible cloud drop with faulty sensor
 *
 * With this library connect the DHT sensor to the following pins
 * Spark Core: D0, D1, D2, D3, D4, A0, A1, A3, A5, A6, A7
 * Particle  : any Pin but D0 & A5
 * See docs for more background
 *   https://docs.particle.io/reference/firmware/photon/#attachinterrupt-
 */

 // NOTE DHT_REPORT_TIMING requires DHT_DEBUG_TIMING in PietteTech_DHT.h for debugging edge->edge timings
 //#define DHT_REPORT_TIMING

#include "PietteTech_DHT.h"

#define DHTTYPEA  DHT22       // Sensor type DHT11/21/22/AM2301/AM2302
#define DHTPINA   D3          // Digital pin for comunications
#define DHTTYPEB  DHT22       // Sensor type DHT11/21/22/AM2301/AM2302
#define DHTPINB   D2          // Digital pin for comunications

// Instantiate two class objects
PietteTech_DHT DHTA(DHTPINA, DHTTYPEA);
PietteTech_DHT DHTB(DHTPINB, DHTTYPEB);
int n;      // counter

#define LOOP_DELAY 5000 // 5s intervals
int _sensorA_error_count;
int _sensorB_error_count;
int _spark_error_count;
unsigned long _lastTimeInLoop;


bool heatOn;




WidgetLCD lcd(V3);

void setup()
{
  Serial.begin(9600);
  while (!Serial.available() && millis() < 30000) {
    Serial.println("Press any key to start.");
    Particle.process();
    delay(1000);
  }
  Serial.println("DHT 2 Sensor program using DHT.acquire and DHT.aquiring");
  Serial.print("LIB version: ");
  Serial.println(DHTLIB_VERSION);
  Serial.println("---------------");

  delay(1000);        // Delay 1s to let the sensors settle
  _lastTimeInLoop = millis();
 
  Serial.begin(9600);
    delay(5000); // Allow board to settle

    Blynk.begin(auth);
}

#if defined(DHT_REPORT_TIMING)
// This function will report the timings collected
void printEdgeTiming(class PietteTech_DHT *_d) {
  byte n;
  volatile uint8_t *_e = &_d->_edges[0];

  Serial.print("Edge timing = ");
  for (n = 0; n < 41; n++) {
    Serial.print(*_e++);
    if (n < 40)
      Serial.print(".");
  }
  Serial.print("\n\r");
}
#endif

void printSensorData(class PietteTech_DHT *_d) {
  int result = _d->getStatus();

  if (result != DHTLIB_OK)
    if (_d == &DHTA)
      _sensorA_error_count++;
    else
      _sensorB_error_count++;

  switch (result) {
  case DHTLIB_OK:
    Serial.println("OK");
    break;
  case DHTLIB_ERROR_CHECKSUM:
    Serial.println("Error\n\r\tChecksum error");
    break;
  case DHTLIB_ERROR_ISR_TIMEOUT:
    Serial.println("Error\n\r\tISR time out error");
    break;
  case DHTLIB_ERROR_RESPONSE_TIMEOUT:
    Serial.println("Error\n\r\tResponse time out error");
    break;
  case DHTLIB_ERROR_DATA_TIMEOUT:
    Serial.println("Error\n\r\tData time out error");
    break;
  case DHTLIB_ERROR_ACQUIRING:
    Serial.println("Error\n\r\tAcquiring");
    break;
  case DHTLIB_ERROR_DELTA:
    Serial.println("Error\n\r\tDelta time to small");
    break;
  case DHTLIB_ERROR_NOTSTARTED:
    Serial.println("Error\n\r\tNot started");
    break;
  default:
    Serial.println("Unknown error");
    break;
  }

#if defined(DHT_REPORT_TIMING)
  // print debug timing information
  printEdgeTiming(_d);
#endif

  Serial.print("Humidity (%): ");
  Serial.println(_d->getHumidity(), 2);
  
  Serial.print("Temperature (oC): ");
  Serial.println(_d->getCelsius(), 2);
  

  Serial.print("Temperature (oF): ");
  Serial.println(_d->getFahrenheit(), 2);
  Blynk.virtualWrite(V5, DHTA.getFahrenheit());
  Blynk.virtualWrite(V10, DHTB.getFahrenheit());

  Serial.print("Temperature (K): ");
  Serial.println(_d->getKelvin(), 2);

  Serial.print("Dew Point (oC): ");
  Serial.println(_d->getDewPoint());

  Serial.print("Dew Point Slow (oC): ");
  Serial.println(_d->getDewPointSlow());
}

void loop()
{
  Blynk.run();
  
  float minTemp = V1;
  float maxTemp = V2;
  

  
  int temp = (int)DHTB.getFahrenheit();
  
  unsigned long _us = millis();
  unsigned long _delta = (_us - _lastTimeInLoop);

  if (_delta > (1.05 * LOOP_DELAY))
    _spark_error_count++;

  // Launch the acquisition on the two sensors
  DHTA.acquire();
  DHTB.acquire();

  // Print information for Sensor A
  Serial.print("\n");
  Serial.print(n);
  Serial.print(" : ");
  Serial.print((float)(_delta / 1000.0));
  Serial.print("s");
  if (_sensorA_error_count > 0 || _spark_error_count > 0) {
    Serial.print(" : E=");
    Serial.print(_sensorA_error_count);
    Serial.print("/");
    Serial.print(_spark_error_count);
  }
  Serial.print(", Retrieving information from sensor: ");
  Serial.print("Read sensor Top: ");

  while (DHTA.acquiring()) Particle.process();
  printSensorData(&DHTA);

  // Print information for Sensor B
  Serial.print("\n");
  Serial.print(n);
  Serial.print(" : ");
  Serial.print((float)(_delta / 1000.0));
  Serial.print("s");
  if (_sensorB_error_count > 0 || _spark_error_count > 0) {
    Serial.print(" : E=");
    Serial.print(_sensorB_error_count);
    Serial.print("/");
    Serial.print(_spark_error_count);
  }
  Serial.print(", Retrieving information from sensor: ");
  Serial.print("Read sensor Bottom: ");

  while (DHTB.acquiring()) Particle.process();
  printSensorData(&DHTB);

  n++;
  _lastTimeInLoop = _us;

  delay(LOOP_DELAY);
  
  
    if (temp < minTemp)
    {
        if (D4 == LOW)
        {
            digitalWrite(D4,HIGH);
            
            
            lcd.clear();
            lcd.print(0,0,"Turning on");
        }
       
    }
    else
    {
        
    }
    if (temp > maxTemp)
    {
        if (D4 == HIGH)
        {
            digitalWrite(D4,LOW);
            
            
            lcd.clear();
            lcd.print(0,0,"Turning off");
        }
    }
    else
    {
        
    }
    if (DHTA.getFahrenheit() > 199)
    {
        if (D4 == HIGH)
        {
            digitalWrite(D4,LOW);
            
            lcd.clear();
            lcd.print(0,0, "OverHeat! Emer-");
            lcd.print(0,1, "gency Shutoff!!");
            delay(600000);
            
        }
    }
    else
    {
        
    }
    if (D4 == HIGH)
    {
        Blynk.virtualWrite(V0,HIGH);
    }
    else
    {
       Blynk.virtualWrite(V0,LOW);
    }
}