Arduino-HomeKit-ESP8266 icon indicating copy to clipboard operation
Arduino-HomeKit-ESP8266 copied to clipboard

Implement temperature, humidity and 2 switches and oled 0.96 to monitor the sensors.

Open KaitoKK1412 opened this issue 1 year ago • 6 comments
trafficstars

Can anyone help me to add two switches and an oled 0.96" so that it shows the temp and humidity in the first sample temperature, humidity. I am new to coding and want to learn new things. I would be thankful if anyone can help me.

KaitoKK1412 avatar Jan 30 '24 09:01 KaitoKK1412

Just the other day I made this little project https://github.com/stuntstein/Arduino_homekit_temp-humi-sensor

stuntstein avatar Mar 25 '24 17:03 stuntstein

Just the other day I made this little project https://github.com/stuntstein/Arduino_homekit_temp-humi-sensor

Cool! I’ll have to check it out, since I can’t get the temp working with any other code, and I’ve tried so many different versions. I also have an oled display never used.

jockethebastard avatar Mar 25 '24 17:03 jockethebastard

IMG_1986

stuntstein avatar Mar 25 '24 19:03 stuntstein

Looks awesome! I guess it’s compatible with smaller oled screen, by adjusting the pixels right?

jockethebastard avatar Mar 25 '24 20:03 jockethebastard

This is one of the smallest, but yes you can change the resolution:

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
#define OLED_RESET     -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

You would also have to adapt the x,y offset when printing your text

  display.setCursor(0, 12);
  sprintf(s,"Tmp: %5.1fC", temp);
  display.print(s);

stuntstein avatar Mar 25 '24 20:03 stuntstein