Arduino lot Cloud'da kod hatası

baspinar2016

Femtopat
Katılım
5 Ekim 2023
Mesajlar
14
Daha fazla  
Cinsiyet
Erkek
Arduino lot Cloud'da çözemediğim bir hata ile karşılaşıyorum. Arduino kodu:

C++:
/*
 Sketch generated by the Arduino IoT Cloud Thing "Untitled 2"
 https://create.arduino.cc/cloud/things/348b4468-a3b9-4387-bad8-197bbef49539

 Arduino IoT Cloud Variables description.

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

 int 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"

#define LLL 9

void setup() {
 // 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.

}

/*
 Since Led is READ_WRITE variable, onLedChange() is.
 executed every time a new value is received from IoT Cloud.
*/
void onLedChange() {
 if(Led == 0){
 digitalWrite(LLL,0);
 }
 if(Led == 1){
 digitalWrite(LLL,1);
 }
 if(Led == 3){
 digitalWrite(LLL,3);
 }
 if(Led == 5){
 digitalWrite(LLL,5);
 }
}

thingProperties.h kodu:

C:
// Code generated by Arduino IoT Cloud, DO NOT EDIT.

#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>

void onLedChange();

int led;

void initProperties(){

 ArduinoCloud.addProperty(led, READWRITE, ON_CHANGE, onLedChange);

}

////////////////////////////ATTENTION!!!////////////////////////////////
// ATTENTION: No device is currently associated to this Thing, //
// hence the Connection Handler code could not be generated //
// Please associate an existing or new device or manually create your //
// instance of Connection Handler //
// Eg. //
// WiFiConnectionHandler ArduinoIoTPreferredConnection(SSID, PASS); //
////////////////////////////////////////////////////////////////////////

#error "No device is currently associated to this Thing, hence the Connection Handler code could not be generated"
 
Arduino lot Cloud'da çözemediğim bir hata ile karşılaşıyorum. Arduino kodu:

C++:
/*
 Sketch generated by the Arduino IoT Cloud Thing "Untitled 2"
 https://create.arduino.cc/cloud/things/348b4468-a3b9-4387-bad8-197bbef49539

 Arduino IoT Cloud Variables description.

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

 int 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"

#define LLL 9

void setup() {
 // 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.

}

/*
 Since Led is READ_WRITE variable, onLedChange() is.
 executed every time a new value is received from IoT Cloud.
*/
void onLedChange() {
 if(Led == 0){
 digitalWrite(LLL,0);
 }
 if(Led == 1){
 digitalWrite(LLL,1);
 }
 if(Led == 3){
 digitalWrite(LLL,3);
 }
 if(Led == 5){
 digitalWrite(LLL,5);
 }
}

thingProperties.h kodu:

C:
// Code generated by Arduino IoT Cloud, DO NOT EDIT.

#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>

void onLedChange();

int led;

void initProperties(){

 ArduinoCloud.addProperty(led, READWRITE, ON_CHANGE, onLedChange);

}

////////////////////////////ATTENTION!!!////////////////////////////////
// ATTENTION: No device is currently associated to this Thing, //
// hence the Connection Handler code could not be generated //
// Please associate an existing or new device or manually create your //
// instance of Connection Handler //
// Eg. //
// WiFiConnectionHandler ArduinoIoTPreferredConnection(SSID, PASS); //
////////////////////////////////////////////////////////////////////////

#error "No device is currently associated to this Thing, hence the Connection Handler code could not be generated"
Hocam tam emin değilim ama hem üstte int led yorum satırı içinde kalmış bir de void onLedchance de if'lerin altında Led yazmışsın led olacaktı sanırım. Bir de digitalwrite (LLL,3) , digitalwrite (LLL,5) yazmışsın digitalWrite da value high low yani 0 1 dışında değer olmaz diye biliyorum.
 

Geri
Yukarı