still wip
This commit is contained in:
15
src/main.cpp
15
src/main.cpp
@@ -16,9 +16,11 @@ Task *updateTask = nullptr;
|
||||
Task *mqttTickTask = nullptr;
|
||||
Task *mqttCheckConnectionTask = nullptr;
|
||||
|
||||
Pin *pinR = new Pin(14, true, true, 5000, 0); // Example pin numbers, adjust as needed
|
||||
Pin *pinG = new Pin(15, true, true, 5000, 1);
|
||||
Pin *pinB = new Pin(16, true, true, 5000, 2);
|
||||
Pin *pinR = new Pin(16, true, true, 5000, 0); // Example pin numbers, adjust as needed
|
||||
Pin *pinG = new Pin(17, true, true, 5000, 1);
|
||||
Pin *pinB = new Pin(18, true, true, 5000, 2);
|
||||
Pin *pinCW = new Pin(19, true, true, 5000, 3);
|
||||
Pin *pinWW = new Pin(21, true, true, 5000, 4);
|
||||
|
||||
Scheduler *scheduler;
|
||||
|
||||
@@ -28,12 +30,17 @@ void setup() {
|
||||
// put your setup code here, to run once:
|
||||
Serial.begin(115200);
|
||||
Serial.println("Starting Smart RGB ESP32...");
|
||||
pinR->setLedLevel(0);
|
||||
pinG->setLedLevel(0);
|
||||
pinB->setLedLevel(0);
|
||||
pinCW->setLedLevel(0);
|
||||
pinWW->setLedLevel(0);
|
||||
network = new Network("smart-rgb");
|
||||
otaHandler = new OTAHandler("smart-rgb-ota");
|
||||
network->registerMDNS();
|
||||
Mqtt::connect("10.238.75.81", 1883, "smart_rgb_client", "mqtt", "mqtt");
|
||||
delay(1000); // Wait for MQTT connection to stabilize
|
||||
light = new Light(pinR, pinG, pinB, mqttClient, "smart_rgb_light");
|
||||
light = new Light(pinR, pinG, pinB, pinCW, pinWW, mqttClient, "smart_rgb_light");
|
||||
initializeScheduler();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user