Hello. I have come here often. for help. I am a senior trying to learn how to make Arduinos do what I want them to do. No colleges in my town have courses in C++. I bought the for Dummies book and borrowed others form the library. I read and try to understand all the tutorials I find here and elsewhere. Needless to say I find it difficult. My knowledge has huge gaps.
So I post in the forums for help. Sometime I get pointed to tutorials that help. Sometimes I get some good advice. Then, again, sometimes the replies I receive feel more like I'm bothering people here. Terse responses and complaints about a mistake I made seem to be more prevalent. It makes me feel that you don't like answering questions from people new to this . I'm sorry for bothering some people here.
Thus, I will not be asking for help here, in the future. I can use the site in a limited way without using the forum. Please, if some others new to this site begin to exasperate you, please be patient.
Everything I learned about C++ was from this forum, and lots of good help. I am certainly no expert, but I have several projects around the house that I have built myself.
Buy a sensor kit. Any sensor kit, and a solderless breadboard. Then look at the example programs in the IDE that would use the sensors in your kit. Have fun.
Don't hesitate to ask for help when something doesn't work.
By the way, Arduino is not pure C++, so you may be confused with C++ programs you have seen in the books. The IDE hides some of the routine parts of a C++ program that every C++ program needs- which makes it easier to learn and use C++ on the Arduino. For example, there is no main() or stdio.h in an Arduino sketch (what Arduino calls a program). (There is, but it's hidden from the user).
boolean (8 bit) - simple logical true/false, Arduino does not use single bits for bool
byte (8 bit) - unsigned number from 0 to 255
char (8 bit) - signed number from -128 to 127. The compiler will attempt to interpret this data type as a character in some circumstances, which may yield unexpected results
unsigned char (8 bit) - same as 'byte'; if this is what you're after, you should use 'byte' instead, for reasons of clarity
word (16 bit) - unsigned number from 0 to 65535
unsigned int (16 bit)- the same as 'word'. Use 'word' instead for clarity and brevity
int (16 bit) - signed number from -32768 to 32767. This is most commonly what you see used for general purpose variables in Arduino example code provided with the IDE
unsigned long (32 bit) - unsigned number from 0 to 4,294,967,295. The most common usage of this is to store the result of the millis() function, which returns the number of milliseconds the current code has been running
long (32 bit) - signed number from -2,147,483,648 to 2,147,483,647
float (32 bit) - signed number from -3.4028235E38 to 3.4028235E38. Floating point on the Arduino is not native; the compiler has to jump through hoops to make it work. If you can avoid it, you should. We'll touch on this later. Sparkfun.
You select the 'type' best suited for your variables.
ex:
your variable does not change and it defines a pin on the Arduino. const byte limitSwitchPin = 34;
since an analog variable can be 0 to 1023, a byte will not do, you can select 'int'. int temperature;
if your variable needs to be within -64 to +64 a 'char' will do nicely. char joystick;
if your variable is used for ASCII then you need type 'char', char myText[] = {"Raspberry Pie Smells"};
if your variable enables some code then boolean can be used. boolean enableFlag = false;
millis() returns the time in ms since rebooting, unsigned long currentTime = millis();
etc.
Polliwog:
It makes me feel that you don't like answering questions from people new to this .
I object very strongly to this sort of generalised complaint without any supporting evidence.
All of the regular contributors to the Forum want to help everyone, especially newbies. There are big differences in the way that people express themselves - some are loquacious and some are succinct. It does not mean that either is more or less friendly.
If you find that a response is unhelpful or offensive the best approach is to use your next Reply in that Thread to confront the person who made the response. If that does not get you a satisfactory result then you should refer the matter to the Moderators.
And if you wish to create a Thread (like this) in which to discuss the problems you have experienced be good enough to provide links to the items that you have found unsatisfactory. At the very least the accused must be given an opportunity to respond to the complaint against them.
As one of the moderators I take particular interest in bad behaviour and will not tolerate it.
If you feel aggrieved with responses please use the REPORT TO MODERATOR option and I assure you any complaint will be looked at.
I am sorry you fell you have had a bad experience in the forum and want to let you know we as a community want you to feel respected regardless of any level of Arduino experience you may have.