Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

2

The return value of strcmp does not have boolean semantics, as you seem to incorrectly assume. strcmp is a tri-state comparator, which returns negative, zero or positive value. For equal strings it returns zero, which means that an equality comparison with strcmp should normally look as follows if (strcmp(str1, str2) == 0) Serial.println("Equals"); else ...


0

There is another string compare function that may work for you strncmp() void setup(){ Serial.begin(9600); char str1[64] = "test with spaces"; char str2[32] = "test with spaces"; if(strncmp(str1, str2, 64) == 0){ Serial.println("strings match"); } else{ Serial.println("strings do not match"); } } void loop(){}


0

Using a static IP address with a gateway is not implemented (as you can see from the source code). To get out to the internet with that library you can only use DHCP (by omitting the WiFi.config(localIp) call).


0

Don't know if you found an answer yet, but I had the exact same issue and eventually came up with this: payload[length] = '\0'; // Add a NULL to the end of the char* to make it a string. int aNumber = atoi((char *)payload); Pretty simple in the end!


1

The information is available on SDK level. If you include #include "user_interface.h", you can use function wifi_station_get_connect_status(). It returns one of: STATION_GOT_IP STATION_NO_AP_FOUND STATION_CONNECT_FAIL STATION_WRONG_PASSWORD STATION_IDLE The WiFi.status() function uses function wifi_station_get_connect_status(), but returns ...


0

Your code looks good. I2C configuration is default which depends on your board manager. Then your wiring may be wrong. Using a multimeter to check supply voltage on the BH1750 module. It should be 3.3V Using a multimeter to check the connection between the BH1750 module with ESP32. Difference ESP32 vendor may provide a difference I2C pinout. Make sure you ...


0

I would suggest taking the resistor/s off the switches, so the button connects to digital inputs to the 3v/5v line. Then use 470ohm resistors for the leds(to limit the current) on the digital outputs.


1

[library] = library name 1) edit the [library] library.properties file and add dot_a_linkage=true to the end ... (/home/name/Arduino/libraries/[library]/library.properties) 2) build the example ... 3) After the build is complete navigate to the build folder (In Linux it's located in the /tmp/arduino_build_xxxxxx folder) then copy the dot_a file from under ...


1

The ESP typically runs on 3.3 Volt, not 3.0 Volt. Secondly, it looks like the board has a voltage regulator, all power goes through the voltage regulator. If that's the case the voltage you need to supply must be lower that the drop-out voltage of the regulator (which is typically around a volt).


1

The syntax of six SendHTML you use with true and false is actually wrong. By defining a function like this String SendHTML(uint8_t LED1status,uint8_t BUZZ1status,uint8_t ABA1status), you mean that first, second and third input to this function are Status of LED1, Status of BUZZ1 and Status of ABA1. So try replacing all six SendHTML with true and false ...


0

Not sure if this is just an academic exercise on your part to learn (which is totally cool), but if you're just trying to move forward and get something working you may consider one of the many excellent button libraries out there for Arduino. I recently used a library called ButtonKing that allowed me to do some very sophisticated menu interactions on a ...


0

Please add the RTC library in the Arduino as below. Open the Library Manager and search for "Rtc by Makuna" and install. You can also checkout the Github page for that particular library at https://github.com/Makuna/Rtc


0

The Arduino IDE is written in Java. It's 100% platform independent, so the version that you download makes no real difference. The most likely culprit is the version of Java that is installed in your computer. I am not sure off hand what versions of Java the Arduino IDE works with, but for certain version 8 will be your best bet. Make sure that you have ...


0

While this isn't the right way of doing it I'm sharing the way that I figured it out. Step1: cd c:\ dir tcp.h /s c:\Program Files (x86)\Arduino\hardware\arduino\avr\firmwares\wifishield\wifiHD\src\SOFTWARE_FRAMEWORK\SERVICES\LWIP\lwip-1.3.2\src\include\lwip c:\Program Files (x86)\Arduino\libraries\WiFi\extras\wifiHD\src\SOFTWARE_FRAMEWORK\SERVICES\LWIP\...


4

An example how to use NTPClient is available at the projects github #include <NTPClient.h> // change next line to use with another board/shield #include <ESP8266WiFi.h> //#include <WiFi.h> // for WiFi shield //#include <WiFi101.h> // for WiFi 101 shield or MKR1000 #include <WiFiUdp.h> const char *ssid = "<SSID>"; ...


Top 50 recent answers are included