User Manual

Table Of Contents
- 8 -
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 16 // OLED display width, in pixels
#define SCREEN_HEIGHT 16 // OLED display height, in pixels
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#define button1 9 // Button B1 is connected to Arduino pin 9
#define button2 8 // Button B2 is connected to Arduino pin 8
#define buzzer 3
void setup(void) {
pinMode(button1, INPUT_PULLUP);
pinMode(button2, INPUT_PULLUP);
pinMode(buzzer, OUTPUT);
digitalWrite(buzzer, HIGH);
delay(1000);
Serial.begin(115200);
// by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr
// init done
// Clear the display buffer.
display.clearDisplay();
display.display();
display.setTextColor(WHITE,BLACK);
display.drawRect(117, 55, 3, 3, WHITE); // Put degree symbol ( ° )
draw_text(0, 55, "TEMPERATURE =", 1);
draw_text(122, 55, "C", 1);
}
char Time[] = " : : ";
char Calendar[] = " / /20 ";
char temperature[] = " 00.00";
char temperature_msb;
byte i, second, minute, hour, day, date, month, year, temperature_lsb;
void display_day(){
switch(day){
case 1: draw_text(0, 0, " SUNDAY ", 1); break;