SEN0501 Example Code fails to compile

userHead tatertots 2023-11-29 09:51:27 347 Views1 Replies

Hello, 

 

I recently purchased a SEN0501 Environmental sensor and have been trying to implement it into a larger project. 

 

However, the example code associated with the sensor online does not compile on the Arudino IDE. 

 

I am trying to connect to the sensor using an Arduino UNO R3 SMD using the I2C connection option (can include picture of wiring if needed).

 

The issue appears to be with the addressing portion of the program:

 

 

If I comment out the line where the error occurs, it claims that the ‘environment’ object is not within the the scope of the loop: 

 

I also tried to define my own 'environment' object and setting an address to 0x22 yields a connection to the device but not the individual sensors (themometer, barometer, etc.)

 

My Arduino is a bit rusty so I am confused as to what the addressing conditionals are trying to do at the beginning of the file, but it seems that they are not working correctly.

 

If anyone has run into similar issues or has potential solutions please let me know

2023-11-30 18:10:55

Please change the “SEN0500/SEN0501_DEFULT_ADDRESS” into 0x22

userHeadPic Yeez_B