Callback definition is incompatible

I use a library which has these definitions typedef void (*CallbackFunction) (ESPRotary&); void ESPRotary::setChangedHandler(CallbackFunction f) { … } When I try to use the setChangedHandler function I get an issue that the definition of my callback is wrong. #pragma once #include "ESPRotary.h" class MyUsermod : public Usermod { private: ESPRotary r = ESPRotary(13, 12); public:… Read More Callback definition is incompatible

Output parameters with arrays in one function with Arduino and C ++

I have a problem with the initialization with various parameters in my function. It works if I have created an array int params [] = {…}. However, it doesn’t work if I want to write the parameters directly into the function. declaration (in the .h) void phase_an(int led[]); in the .cpp void RS_Schaltung::phase_an(int led[]) {… Read More Output parameters with arrays in one function with Arduino and C ++

error: void value not ignored as it ought to be in Arduino

This is a function to convert 1 digit number to 3 digit. For example convert ‘2’ to ‘002’. void loop() { int x = convertdigit(time); } void convertdigit(int num){ char buffer[50]; int n; n=sprintf (buffer, "%03d",num); return buffer; } Error: void value not ignored as it ought to be /sketch/sketch.ino: In function ‘void loop()’: /sketch/sketch.ino:33:30:… Read More error: void value not ignored as it ought to be in Arduino

how to get only the module name ModuleNotFoundError

How only to print the module name with ModuleNotFoundError arguments in python. my code: try: import requests except ModuleNotFoundError as error1: print(error1) In this case I am getting output as below: No module named ‘requests’ I want to be printed only the name of the module that met the exception. output I need: ‘requests’ Regards,… Read More how to get only the module name ModuleNotFoundError