C++ is used in Arduino, so it's advisable to learn that first. Here is a link to some useful tutorials to help you learn the basics of c++.
There are, however, several parts of Arduino coding that is different from c++. I'll begin listing those here to the best of my ability.
There are, however, several parts of Arduino coding that is different from c++. I'll begin listing those here to the best of my ability.
- Void setup()-This function is the beginning of every program in Arduino c++. It serves to set up everything you will need such as pinModes.
- void loop()- This function is commonly the main body of your program. It runs repeatedly unless programmed to stop with a permanent delay.
- pinMode(pin number,type)-This configures a pin to be either a input or output based on what you need it for.
- digitalWrite(pin number, level)- Allows the writing of a level HIGH or LOW to a pin for output.
- digitalRead(pin number)-Reads HIGH or LOW incoming voltage.
- analogWrite(pin number, level)- Allows a specific level to be written so the object can be more than simple on or off.
- analogRead(pin number)- Reads an analog input to return the level of electricity flowing into it.
- delay(number i milliseconds)- Pauses the program for a set number of milliseconds.
- serial.Begin()- Begins the serial window so analog inputs can be printed
- serial.Print()- Prints the variable or data that you want to recieve.
- serial.End()-Ends the serial window so that no further data will be printed.
For more information on how all the circuits actually work (the physics of a circuit). This site has a lot of resources. http://www.physicsclassroom.com/Class/circuits/