EasyManuals Logo

SunFounder ESP32 User Manual

Default Icon
771 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #191 background imageLoading...
Page #191 background image
SunFounder ESP32 Starter Kit
2. Fill in the topics you desire to follow and click Subscribe. In the code, we send temperature information to the
topic SF/TEMP.
void loop() {
if (!client.connected()) {
reconnect();
}
client.loop();
// if the button pressed, publish the temperature to topic "SF/TEMP"
if (digitalRead(buttonPin)) {
long now = millis();
if (now - lastMsg > 5000) {
lastMsg = now;
char tempString[8];
dtostrf(thermistor(), 1, 2, tempString);
client.publish("SF/TEMP", tempString);
}
}
}
3. Hence, we can monitor this Topic on HiveMQ, allowing us to view the information you have published.
1.48 8.5 CheerLights
CheerLights is a global network of synchronized lights that can be controlled by anyone.
Join the LED color-changing community, which allows LEDs around the world to change colors simultaneously.
You can place your LEDs in a corner of your office to remind yourself that you are not alone.
In this case, we also utilize MQTT, but instead of publishing our own messages, we subscribe to the “cheerlights” topic.
This allows us to receive messages sent by others to the “cheerlights” topic and use that information to change the color
of our LED strip accordingly.
Required Components
In this project, we need the following components.
Its definitely convenient to buy a whole kit, heres the link:
Name ITEMS IN THIS KIT LINK
ESP32 Starter Kit 320+
1.48. 8.5 CheerLights 185

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the SunFounder ESP32 and is the answer not in the manual?

SunFounder ESP32 Specifications

General IconGeneral
BrandSunFounder
ModelESP32
CategoryController
LanguageEnglish