Hi,
I'm new to this eco-system.
I'm using the below simple sketch generated by cloud IOT. The board is nano IOT. When compiling it I'm getting 6 warnings about "warning: changing start of section .bss by 4 bytes
Sketch uses 107272 bytes (40%) of program storage space. Maximum is 262144 bytes.
if i'm downloading this sketch to the laptop and use IDE, I have the same warnings.
When running a blink example on laptop, no warning. Any idea what I should explore or what cause it?
------- code -------
#include "arduino_secrets.h"
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/e85302f8-d1a7-4082-ba3e-e606ffc9fa50
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
String jSON;
float humid_in;
float p_UL;
float temp_in;
int smoke;
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 <ArduinoJson.h>
#include "Wire.h"
#include "Adafruit_SHT31.h"
#include <SensirionI2CScd4x.h>
Adafruit_SHT31 sht31 = Adafruit_SHT31();
SensirionI2CScd4x scd4x;
uint16_t co2;
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
Serial1.begin(9600);
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
delay(1000);
// 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();
//---------------------------------------------------------------------------
Wire.begin();
delay(1000);
scd4x.begin(Wire);
scd4x.stopPeriodicMeasurement();
scd4x.startPeriodicMeasurement();
if (! sht31.begin(0x44)) { // Set to 0x45 for alternate I2C address
Serial.println("Couldn't find SHT31");
while (1) delay(1);
}
}
void loop() {
ArduinoCloud.update();
// Your code here
StaticJsonDocument<192> doc;
float t=44.4; //prob temprature
float h=55.5; //prob humidity
int fsrPinUR = 0; // the FSR and 10K pulldown are connected to a0
int fsrReadingUR; // the analog reading from the FSR resistor divider
fsrReadingUR = analogRead(fsrPinUR);
p_UL = fsrReadingUR;
t = (sht31.readTemperature() * 9 / 5) + 32; //(0°C × 9/5) + 32
h = sht31.readHumidity();
humid_in = h;
temp_in = t;
float CO_temperature = 0.0f;
float CO_humidity = 0.0f;
bool isDataReady = false;
scd4x.getDataReadyFlag(isDataReady);
if (isDataReady) {
scd4x.readMeasurement(co2, CO_temperature, CO_humidity);
}
smoke=co2;
doc["ID"] = "1";
doc["T"] = t;
doc["H"] = h;
doc["WF"] = 123456.67;
doc["S"] = co2;
JsonObject P = doc.createNestedObject("P");
P["UR"] = p_UL;
P["LR"] = 999.99;
P["UL"] = 999.99;
P["LL"] = 999.99;
delay(1000);
//if (Serial1.available()) {
serializeJson(doc, Serial1);
//}
//if (Serial.available()) {
serializeJson(doc, Serial);
//}
// The above line prints:
// {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}
// Start a new line
Serial.println();
// Generate the prettified JSON and send it to the Serial port.
//
serializeJsonPretty(doc, jSON);
delay(1000);
}
/*
Since TempIn is READ_WRITE variable, onTempInChange() is
executed every time a new value is received from IoT Cloud.
*/
void onTempInChange() {
// Add your code here to act upon TempIn change
}
/*
Since HumidIn is READ_WRITE variable, onHumidInChange() is
executed every time a new value is received from IoT Cloud.
*/
void onHumidInChange() {
// Add your code here to act upon HumidIn change
}
/*
Since JSON is READ_WRITE variable, onJSONChange() is
executed every time a new value is received from IoT Cloud.
*/
void onJSONChange() {
// Add your code here to act upon JSON change
}
/*
Since PUL is READ_WRITE variable, onPULChange() is
executed every time a new value is received from IoT Cloud.
*/
void onPULChange() {
// Add your code here to act upon PUL change
}
/*
Since Smoke is READ_WRITE variable, onSmokeChange() is
executed every time a new value is received from IoT Cloud.
*/
void onSmokeChange() {
// Add your code here to act upon Smoke change
}