Arduino tempereture logger for at least 128 DS18B20 sensors or less on oled display and sdcard. User selects via 4 buttons and a simple menu how many hours the logging would start all over again. Button 1 is Up button 2 is Down button 3 is OK button 4 is Reset. The simple menu would read "Log for," i " hours" where when the up buton is pressed the i index would increase or when the button Down is pressed it would decrease. Pressing ok button would start the logging process where the tempereture of each sensor would be displayed on the display and stored on the sd card as a txt file . When the code finished logging after i hours the simple menu would display again until the button Reset is pressed where a tempereture graph of the logged temps will be displayed on the screen. Generate a simple code
#include <OneWire.h> #include <DallasTemperature.h> #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels // Declaration for SSD1306 display connected using software SPI: #define OLED_MOSI 9 #define OLED_CLK 10 #define OLED_DC 12 #define OLED_CS 11 #define OLED_RESET 13 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS); // Data wire is plugged into pin 2 on the Arduino #define ONE_WIRE_BUS 2 // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas