Looking for a good source (or even a book to buy) on learning how to write sketches for projects. I am at an entry level beginner with Arduino. Just received a super starter UNO R3 project kit along with an additional 37 sensor kit 2.0 and a book titled "Step-by-step guide for absolute beginners" by Danielle Bell. The book is useless as far as learning the basics on writing sketches and anything I've seen on you tube or online just shows people writing out their sketches off the top of their head without explaining why certain keywords and fonts are used and the correlation of words in sketches describing the desired command and sensor input by the controller. Although I am at entry level with Arduino, I have however over 30 years experience in the auto repair field specializing in diagnosing and repairing automotive electronics for automotive and heavy duty diesel engine electronics. My field involves using oscilloscopes with various probes to measure dozens of various sensors (Temperature, speed, position/pots etc) into ECM's (Engine control modules) and corresponding actuators (valves, servos, motors etc.) I custom fabricate many electro mechanic projects at home for specific purposes like tool making and home projects or for stupid fun like a remote controlled gas powered picnic table that I use at my cottage to help tow our essentials from the house down to the lake and back. So far I have been achieving the electronic part of my projects by gutting discarded already existing electronics like an old RC car for the above mentioned project and involving relays, pre fab time delay circuits, limit switches etc to try and make a "brain" for my automated or controlled projects. This kind of "Frankenstein" controller fabrication can be frustrating, time consuming and unreliable. I know that Arduino hardware and software is perfectly suited for my projects and ideas and is the next step in my future learning and education.
So right now the only thing in my way is to learn how to wright sketches for my custom projects without having to copy and paste or find one preexisting in someone's videos or libraries that they are able to type out right out of there head.
Where do you learn the code terminology at that level?
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.
My tutorials may help once you have run the basic tutorials and want to move on to other things.
My advice is to stay away from the C++ stuff. It gets complex and you will get lost very quickly and Arduino sketches do not use most of what C++ can do
Arduino is more like C code with Classes.