I'm going through some code to expand my knowledge past the arduino first timer code and have come across two occasions were I could do with a bit of your expertise
Here goes
sendMSG - can anyone explain this one to me?
going through some code for rs485 communication I came across the following line any idea what the ! is for?
state2=!state2;
Let me apologise just in case these questions are easy to answer but I have been going through all my notes google etc and can't find anything
In what context? We had to lay off the psychic. Budget problems, you know.
any idea what the ! is for?
It's the not operator. It sets state2 to the state that is was not set to before. If state2 was true, it becomes false. If it was false, it becomes true.
Let me apologise just in case these questions are easy to answer
The sendMsg() line is a function call, like analogRead(), Serial.read(), etc.
Correction: analogRead() is a function call, Serial.read() is a method call as read() is a method of the Serial object.
If you're going to correct someone, you should probably do it correctly
Last I checked, C++ doesn't have methods. It has member functions. And functions are members of classes, not objects. Objects are instances of classes. The reason this matters, in turn, is that some dynamic languages do allow methods added to objects (and also typically call them methods). C++ isn't one such language, though.