MCPcopy Create free account
hub / github.com/agungferdi/Smart_Farming / initializeComponents

Function initializeComponents

iot-devices/src/main.cpp:95–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void initializeComponents() {
96 Serial.println("Initializing components...");
97
98 Wire.begin(Pins::SDA_PIN, Pins::SCL_PIN);
99 delay(100);
100
101 if (!oled.begin()) {
102 Serial.println("OLED initialization failed!");
103 Serial.println("Continuing without display...");
104 }
105
106 dht11.begin();
107 soilTempSensor.begin();
108 rainSensor.begin();
109 relay.begin();
110
111 Serial.printf("DHT11 on GPIO%d, Soil moisture on GPIO%d, Relay on GPIO%d\n",
112 Pins::DHT11_PIN, Pins::SOIL_MOISTURE_PIN, Pins::RELAY_PIN);
113 Serial.printf("Rain sensor on GPIO%d, Water level on GPIO%d, Modem relay on GPIO%d\n",
114 Pins::RAIN_SENSOR_PIN, Pins::WATER_LEVEL_PIN, Pins::MODEM_RELAY_PIN);
115 Serial.printf("OLED on SDA%d/SCL%d\n", Pins::SDA_PIN, Pins::SCL_PIN);
116}
117
118bool readAllSensors() {
119

Callers 1

setupFunction · 0.85

Calls 1

beginMethod · 0.45

Tested by

no test coverage detected