I am building a project using sensor builder hardware and came with errors.
I thought the job will work out of the box but l have some issues
I am using the sunlight sensor. Here is the sensorbuilder.ino:
#include <Arduino.h>
#include “sensorBuilder.hpp”
SensorBuilderClass SensorBuilder;
void setup(){
Serial.begin(115200);
SensorBuilder.check_grove();
Serial.println(“SensorBuilder add Sunlight”);
sensorSunlight *sunlight = new sensorSunlight();
SensorBuilder.addSensor(sunlight);
sensorNew *newSensor = new sensorNew();
SensorBuilder.addSensor(newSensor);
SensorBuilder.begin();
}
void loop(){
SensorBuilder.poll();
}
Here are the errors:
In file included from /home/pangaea/Arduino/libraries/Seeed_Arduino_S2110/src/sensorBuilder.hpp:12,
from /home/pangaea/Desktop/sensorBuilder/sensorBuilder.ino:2:
/home/pangaea/Arduino/libraries/Seeed_Arduino_S2110/src/sensor/sensorSunlight.hpp: In member function ‘virtual bool sensorSunlight::sample()’:
/home/pangaea/Arduino/libraries/Seeed_Arduino_S2110/src/sensor/sensorSunlight.hpp:72:24: error: ‘class Si115X’ has no member named ‘ReadHalfWord’
72 | float IR = _si1151.ReadHalfWord();
| ^~~~~~~~~~~~
/home/pangaea/Arduino/libraries/Seeed_Arduino_S2110/src/sensor/sensorSunlight.hpp:73:25: error: ‘class Si115X’ has no member named ‘ReadHalfWord_VISIBLE’
73 | float VLR = _si1151.ReadHalfWord_VISIBLE();
| ^~~~~~~~~~~~~~~~~~~~
/home/pangaea/Arduino/libraries/Seeed_Arduino_S2110/src/sensor/sensorSunlight.hpp:74:24: error: ‘class Si115X’ has no member named ‘ReadHalfWord_UV’
74 | float UV = _si1151.ReadHalfWord_UV();
| ^~~~~~~~~~~~~~~
/home/pangaea/Desktop/sensorBuilder/sensorBuilder.ino: In function ‘void setup()’:
/home/pangaea/Desktop/sensorBuilder/sensorBuilder.ino:62:3: error: ‘sensorNew’ was not declared in this scope; did you mean ‘sensorUV’?
62 | sensorNew *newSensor = new sensorNew();
| ^~~~~~~~~
| sensorUV
/home/pangaea/Desktop/sensorBuilder/sensorBuilder.ino:62:14: error: ‘newSensor’ was not declared in this scope
62 | sensorNew *newSensor = new sensorNew();
| ^~~~~~~~~
/home/pangaea/Desktop/sensorBuilder/sensorBuilder.ino:62:30: error: expected type-specifier before ‘sensorNew’
62 | sensorNew *newSensor = new sensorNew();
| ^~~~~~~~~
exit status 1
Compilation error: ‘sensorNew’ was not declared in this scope; did you mean ‘sensorUV’?
I also followed the steps here:
Paragraph Step 2 is confusing…
" Define the sensor class and implement the init()
and sample()
functions.
The sensor class should inherits from the sensorClass
class, and implement the init()
and sample()
functions."
How and where do I have to implement that?
Is any example to have all the steps and all the code needed to implement sensors on sensor builder platform?
Thank you