Top.Mail.Ru
Ответы

Ошибка в Arduino ide

Ошибка в Arduino ide

почему-то у меня выдает ошибку Compilation error: expected primary-expression before ')' token

хотя я смотрю все нормально помогите решить проблему внизу код

помогите чем сможите

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
#include "arduino_secrets.h"
/* 
  Sketch generated by the Arduino IoT Cloud Thing "Untitled"
  https://create.arduino.cc/cloud/things/7d9d82a4-3bd2-4a8a-8b0c-78e0e0eae60f 

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  float hu;
  float tempe;
  bool lED;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#include "thingProperties.h"

#include <DHT11.h>
DHT11 dht11(5, DHT11); здесь ошибку показывает

void setup() {

  dht11.begin(); здесь ошибку показывает

  
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(1500); 

  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  // Your code here 

  hum = dht11.readHumidity(); и здесь ошибку показывает
  tempe = dht11.readTemperature();

  delay(1000);
}


/*
  Since LED is READ_WRITE variable, onLEDChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onLEDChange()  {
}

/*
  Since Temp is READ_WRITE variable, onTempChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onTempChange()  {
  // Add your code here to act upon Temp change
}


/*
  Since Tempe is READ_WRITE variable, onTempeChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onTempeChange()  {
  // Add your code here to act upon Tempe change
}

/*
  Since Hu is READ_WRITE variable, onHuChange() is
  executed every time a new value is received from IoT Cloud.
*/
void onHuChange()  {
  // Add your code here to act upon Hu change
}
Только авторизированные пользователи могут оставлять свои ответы
Дата
Популярность
Аватар пользователя
Ученик

Библиотеку переустанавливал?

Аватар пользователя
Искусственный Интеллект

Не подключена библиотека Wire. Вот вам кусок правильного кода:

#include <DHT.h>

#include <Wire.h>

DHT dht(2, DHT22); // Create DHT class

Рекомендую пин и тип задавать отдельно - на случай, если придется менят