Hello I'm using arduino cloud on my project wherein I have to send data from my sensor(MQ137) to cloud. My issue is that when uploading there is this error which I don't understand (I'm a newbie at coding). Any help would be appreciated. I'm using arduino R4 btw.
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/21ebf3ad-8275-4682-9edd-a53adea28f5c
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
float ammonia;
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"
const int AMMONIA_SENSOR_PIN = A0;
const float SENSOR_VOLTAGE_REF = 5.0;
const float ADC_RESOLUTION = 1023.0;
const float M = -0.263; // Slope
const float B = 0.42; // Y-Intercept
const float R0 = 35; // Sensor resistance in fresh air
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
ammonia = readAmmoniaLevel();
Serial.print("Ammonia: ");
Serial.print(ammonia, 2);
Serial.println(" ppm");
delay(1000);
}
float readAmmoniaLevel() {
int sensorValue = analogRead(AMMONIA_SENSOR_PIN);
float sensorVolt = sensorValue * (SENSOR_VOLTAGE_REF / ADC_RESOLUTION);
float RS_gas = ((SENSOR_VOLTAGE_REF * 10.0) / sensorVolt) - 10;
float ratio = RS_gas / R0;
return pow(10, (log10(ratio) - B) / M);
}
Error Message:
/usr/local/bin/arduino-cli compile --fqbn arduino:renesas_uno:unor4wifi --build-cache-path /tmp --output-dir /tmp/91347586/build --build-path /tmp/arduino-build-FC3D34456FC98B2D55974ABF93784CF4 /tmp/91347586/Untitled_mar03b
[info] Sketch uses 108808 bytes (41%) of program storage space. Maximum is 262144 bytes.
[info] Global variables use 9752 bytes (29%) of dynamic memory, leaving 23016 bytes for local variables. Maximum is 32768 bytes.
I'm using the online IDE also.