I am new with this technology (2 weeks around) but already have a couple of ideas I want to realize and I already did.
Right now I finished my first library class and *.h file and see, it works.
But now questions come up.
About me, I am professional programmer for C#, still some skill in Delphi and VB only few in C or C++.
Right now, I am searching for something for my Arduino Uno to send something like an event.
Question 1:
Is it possible to create an Event inside a Class? And do you have a easy example for my understanding?
As I wrote before, I have low knowledge of C or C++. In C# it is easy to create an Event, which you can fire if something happens.
Let's say there is a error within a class and you find.
You can do now ignore, which is bad, or you can fire an Event, which can be caught in your main routine, or wherever you want.
You even call this Event Wedding. If whatever happens in your Code, you can fire the Event Wedding and the Method, Class or Main routine in where you read that Event knows what is going on.
this is so far what I was searching for. The only question and I quote myself here:
"Right now, I am searching for something for my Arduino Uno to send something like an event."
is this then working with that simple Language of an Arduino or less.
C++ is a powérful language, you even can develop visual Code with windows like Windows or Unix for example.
But sure you can not use a Dot.Net library, or code you would write for that.
So my question is still - Can I use Events within a class for the Arduino.
Many languages have this concept of communication, but I don't know yet about Arduino.
Arduino language is C++. Only a few very memory intensive features have been omitted from the implementations for smaller processors like on the UNO.
Of course, you will not see any libraries that produce bloated code, suitable only for PCs or servers.
I suggest that the code I linked to, will probably compile and run just fine on an Arduino, but I didn't look closely. It was really supposed to be just a starting point for investigation.