hi. i have some problem with this code. i was combine FreeRTOS with blynk seial USB example but its does not work. it is the blynk support with FreeRTOS? how to fixed this code ? thanks
#include <Arduino_FreeRTOS.h>
#include <dht.h>
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3);
#define BLYNK_PRINT DebugSerial
#include <BlynkSimpleStream.h>
char auth[] = "token";
void HUMIDITY( void *pvParameters );
void BLYNK( void *pvParameters );
void setup()
{
Serial.begin(9600);
while (!Serial) {
;
}
xTaskCreate(
BLYNK
, (const portCHAR *)"BLYNK"
, 128
, NULL
, 1
, NULL );
xTaskCreate(
HUMIDITY
, (const portCHAR *)"HUMIDITY"
, 128
, NULL
, 2
, NULL );
}
void loop()
{
}
void BLYNK(void *pvParameters)
{
(void) pvParameters;
DebugSerial.begin(9600);
Serial.begin(9600);
Blynk.begin(auth, Serial);
for(;;)
{
Blynk.run();
}
}
void HUMIDITY(void *pvParameters)
{
(void) pvParameters;
Serial.begin(9600);
pinMode(8, OUTPUT);
dht DHT;
for(;;)
{
int maxtemp = 32;
int readData = DHT.read22(A2);
float t = DHT.temperature;
float h = DHT.humidity;
Serial.print("Temperature = ");
Serial.print(t);
Serial.print(" *C ");
Serial.print(" Humidity = ");
Serial.print(h);
Serial.println(" % ");
if(t > maxtemp){
digitalWrite(8, HIGH);}
else{
digitalWrite(8, LOW);
}
delay(500);
}
}