Dear forum members.
I have a project using a Uno R3 and DHT22, TSL2561 and ML8511 sensors in combination with a data logging shield with RTC.
I needed to move this project from a 16x24 LCD to a much smaller and denser information OLED. This is a Sainsmart 0.96 inch I2C OLED. I have tried various OLED libraries to varying degrees of success. I would have liked to stay with the Adafruit library but its requirement for the sensor and GFX libraries blew away the memory requirements using the Uno.
I cannot move to the Due for other reasons so must find away to use the Uno. Using the U8glib library things are tight in memory but it all works reliably. EXCEPT that each time a call to save to the SD card occurs, the current sensor data set is written "8" times.
I believe that this relates to the ML8511 function of using the Uno's 3.3 V regulated voltage to compare against that produced by the ML8511 sensor and thus arrive at the amount of UV falling upon the ML8511 sensor.
BUT, it might also relate to the OLED's having 8 page regions.
I have tried every iteration I can think of to get the data sent to the SD card to be the normal one data set per time interval but to no avail.
I will attach the sketch as if I include the code in the body of this posting it is too many characters.
Thank you in advance for your help.
DHT22_2561_ML8511_if_else_RTC_SD_No_String_MGM_2_may_03a.ino (7.88 KB)