I currently have an SSD 1315 OLED and a DH20 (black cover) temp sensor from the Arduino Sensor Kit. I want them to interface with my Arduino Uno R3 with 2 grove to 4 pin connectors, and get the OLED to display the info. I also don't want to use a breadboard as I will be attempting to integrate this into a small 3d printed case that will go onto the wall. I currently am able to get the OLED to work fine and they both worked fine together when in the default PCB. However, I have no idea how to hook up the temp sensor or how to code it.
This is the code that worked fine with the parts still on the default PCB.
Code:
#include "Arduino_SensorKit.h"
#define Environment Environment_I2C
void setup() {
Serial.begin(9600);
Environment.begin();
Oled.begin();
Oled.setFlipMode(true);
}
void loop() {
Oled.setFont(u8x8_font_amstrad_cpc_extended_r);
//cursor values are in characters, not pixels
Oled.setCursor(3, 3);
Oled.print("T: ");
Oled.print(Environment.readTemperature());
Oled.print("C");
Oled.setCursor(2, 5);
Oled.print("Hum: ");
Oled.print(Environment.readHumidity());
Oled.print("%");
Oled.setCursor(2,0);
Oled.print("Hi");
Oled.setCursor(4,1);
Oled.print("Good Times!");
delay(10);
}