Category : arduino-c++

This example would have me create all motor objects within the global scope and pass them in. Motor motor1; Motor motor2; Motor motor3; class Axis { public: Axis(Motor motor) { motor.doStuff(); } }; Axis axis1(motor1); Axis axis2(motor2); Axis axis3(motor3); or This example would organize my motor objects into their respective axis objects. class Axis { ..

Read more

This example would have me create all motor objects within the global scope and pass them in. #include <Motor.h> Motor motor1; Motor motor2; Motor motor3; class Axis { private: Motor _motor; public: Axis(Motor motor) { _motor = motor; _motor.doStuff(); } }; Axis axis1(motor1); Axis axis2(motor2); Axis axis3(motor3); or This example would organize my motor objects ..

Read more

I think this is the right stack for this question as its fundamentally C++ although to be specific its a NodeMCU (ESP8266) being programmed in Arduino with the Visual Code IDE. I am using the Pubsubclient MQTT library within a custom ‘ComsManager’ Class library as part of a environmental monitoring system. Generally everything is working ..

Read more

This is a part of Arduino program(C++). MCU is ESP32. I have defined a class. Inside it I have created an array of member functions. class IRDN_Padidar_Zone { bool callAnimation(); uint16_t Animate_None(enum_Effect inOut); uint16_t Animate_Print(enum_Effect inOut); uint16_t Animate_Print_Random(enum_Effect inOut); uint16_t Animate_Print_Barfak(enum_Effect inOut); uint16_t Animate_Print_Laser(enum_Effect inOut); typedef uint16_t (IRDN_Padidar_Zone::*animatFunction)(enum_Effect); animatFunction animations[] = {&IRDN_Padidar_Zone::Animate_None,&IRDN_Padidar_Zone::Animate_Print,&IRDN_Padidar_Zone::Animate_Print_Random,&IRDN_Padidar_Zone::Animate_Print_Barfak,&IRDN_Padidar_Zone::Animate_Print_Laser}; }; bool IRDN_Padidar_Zone::callAnimation(enum_Effect ..

Read more

I use example of mDNSResolver library to resolve a local Host name to IP address . It work as i expect But when i change resolve object to a pointer as follow, the program can’t resolve any local host name anymore. #include <ESP8266WiFi.h> #include <WiFiUdp.h> #include <mDNSResolver.h> #include <WiFiClient.h> #define WIFI_AP "myap" #define WIFI_PASS "mypass" ..

Read more