Issue uploading first code (eco watch lesson)

I've been repeatedly trying to upload a tweaked code for the first lesson and get the same error message. I notice similar phrases in an error message I get a lot. This is my first Arduino product (plug and make kit) and I'm only just familiarizing myself with the hardware and software. I've attached the error code,
Thank you!

WARNING: library ArduinoGraphics claims to run on samd architecture(s) and may be incompatible with your current board which runs on renesas_uno architecture(s).


/var/run/arduino/user-cache/sketches/BAA0844294BC46A6BD859EDE0B600E83/sketch/objs.a(Eco_Watch_mar21c.ino.cpp.o): In function `initProperties()':
/run/arduino/sketches/Eco_Watch_mar21c/thingProperties.h:27: undefined reference to `onMaxTempChange()'
/run/arduino/sketches/Eco_Watch_mar21c/thingProperties.h:27: undefined reference to `onMinTempChange()'
/run/arduino/sketches/Eco_Watch_mar21c/thingProperties.h:27: undefined reference to `onLightSwitchChange()'
collect2: error: ld returned 1 exit status
Multiple libraries were found for "RTC.h"
  Used: /run/arduino/directories-data/packages/arduino/hardware/renesas_uno/1.4.1/libraries/RTC
  Not used: /run/arduino/directories-data/internal/M5Core2_0.2.0_b8c417594bcb0714
  Not used: /run/arduino/directories-data/internal/M5StickC_0.3.0_a99c11f2c0b70886
  Not used: /run/arduino/directories-data/internal/M5StickCPlus_0.1.1_3da481354d8492d0
  Not used: /run/arduino/directories-data/internal/M5Station_0.0.1_59c962b74b2e5439
Multiple libraries were found for "Wire.h"
  Used: /run/arduino/directories-data/packages/arduino/hardware/renesas_uno/1.4.1/libraries/Wire
  Not used: /run/arduino/directories-data/internal/FlexWire_1.2.1_1fc5f1d1a14af0e7
Multiple libraries were found for "SPI.h"
  Used: /run/arduino/directories-data/packages/arduino/hardware/renesas_uno/1.4.1/libraries/SPI
  Not used: /run/arduino/directories-data/internal/EventEthernet_1.0.0_bd9dd894ef7641f8

Welcome to the forum

Please post the full sketch that you are trying to upload, using code tags when you do

When you say that you tweaked the code, what did you do to it ? Has every opening brace got a corresponding closing brace in the correct place in the code ? Is there any code not in a function ?

Sorry I meant to elaborate in the initial post. When it didn't work after the first couple tries I completely deleted everything in the sketch and replaced it with a copy of the sketch in the lesson. still the same error

Please post the sketch that causes the error

#include <Modulino.h>
#include "thingProperties.h"
#include <ArduinoGraphics.h>
#include <Arduino_LED_Matrix.h>
#include <Arduino_CloudConnectionFeedback.h>

// Create object instances
ModulinoThermo thermo;
ArduinoLEDMatrix matrix;

void setup() {
Serial.begin(9600);
delay(1500);

matrix.begin();

//Set up Arduino Cloud
initProperties();
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
waitForArduinoCloudConnection(matrix);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();

// Call all necessary .begin() function
Modulino.begin();
thermo.begin();
}

void loop() {

ArduinoCloud.update();

// Assign environmental reading to variables. 'temperature' is a cloud variable.
temperature = thermo.getTemperature();
humidity = thermo.getHumidity();

// Print the temperature and humidity values to Serial
Serial.print("Temperature = ");
Serial.print(temperature);
Serial.print(" °C");

Serial.print ("          ");

Serial.print("Humidity    = ");
Serial.print(humidity);
Serial.println(" %");

// Convert numbers and assign them to strings
String temperatureText = "Temp: " + String(temperature, 2) + "°C";
String humidityText    = "Humid: " + String(humidity, 2) + "%";

// Settings for the LED Matrix
matrix.beginDraw();
matrix.stroke(0xFFFFFFFF);
matrix.textScrollSpeed(50);

// Add the text
matrix.textFont(Font_5x7);
matrix.beginText(0, 1, 0xFFFFFF);
matrix.println("    " + temperatureText + "    " + humidityText);
matrix.endText(SCROLL_LEFT);
matrix.endDraw();
}

/run/arduino/sketches/Eco_Watch_mar21c/thingProperties.h:27: undefined reference to `onMaxTempChange()'
/run/arduino/sketches/Eco_Watch_mar21c/thingProperties.h:27: undefined reference to `onMinTempChange()'
/run/arduino/sketches/Eco_Watch_mar21c/thingProperties.h:27: undefined reference to `onLightSwitchChange()'

The error is happening because some functions are missing from thingProperties.h

Please post thingProperties.h

Do you have "things" named MaxTemp, MinTemp and LightSwitch in your project ?

The functions should be defined in the .ino file. The thingProperties.h file is automatically generated by the Arduino Cloud IoT system so it is a bad idea to put any user code in there.

I know you are aware, but just to make sure we effectively communicate, I'll mention that the correct term is "Variable". The term "Thing" has a different meaning:

https://docs.arduino.cc/arduino-cloud/cloud-interface/things

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.