Arduino_Starter_Kit_Tutorial - jimaobian/DFRobotWiki GitHub Wiki
Introduction
What is Arduino Starter Kit? The Arduino Starter Kit is a tool specially designed for beginners. It will lead you into the fascinating world in which you will experience the power of electronic technology. No soldering work is required in all experiments. Users just need take advantage of the bread board offered, and this significantly boosts the learning process. Additionally, ten experiment courses are provided in this manual. These ten courses are sorted according to their difficulties and complexities. By reading the explanations, sample connections and sample codes, users can get a better understanding of Arduino. Each experiment also leaves much space for users to utilize their creativity and imagination to expand the experiment. To sum up, the Arduino Starter Kit is an efficient tool for starters to learn Arduino. What is Arduino ? Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. Users can take advantage of the LEDs, buzzer, press button, photo resistor, and other components provided in the starter kit on Arduino platform. Arduino's Feature # Open-source circuit design, free download
- Easy to download softwares
- Easy to be connected to sensors and different electronic components(Such as: LED, buzzer, press button, photo resistor, etc)
- High-speed microprocessor (ATMEGA328)
- Simple developing environment and easy to start
Performance Description # Digital Input/Output 0 ~13
- Analog Input/Output 0 ~13
- Support ISP download
- Input voltage :USB power supply, or 5V ~ 9V DC power supply
- Output voltage: 5V / 3.3V DC
- High-speed Atmel Atmega328 microprocessor
- Size : width 70mm × height 54mm
Arduino C programming language The Arduino programming language is based on C/C++. However, starters are only required to have some basic knowledge of C. The Arduino C simplifies the parameters so that users do not need to learn the basic layer of AVR microprocessor. The following are some simple Arduino C language. Key word:
- If
- If....Else
- For
- Switch Case
- while
- do....while
- break
- continue
- return
- goto
Syntax: # ; (semiconlon)
-
{} (curly braces)
-
// (single line comment)
-
/**/ (multi-line comment)
-
- define
-
- include
Arismetic Operators: # = (assignment operator)
-
- (addition)
-
- (subtraction)
-
- (multiplication)
-
/ (division)
-
% (modulo)
Comparison Operators: # == (equal to)
- != (not equal to)
- < (less than)
- > (greater than)
- <= (less than or equal to)
- >= (greater than or equal to)
Boolean Operators: # && (and)
- || (or)
- ! (not)
Compund Operators: # ++ (increment)
-
-- (decrement)
-
+= (compound addition)
-
-= (compound subtraction)
-
- = (compound multiplication)
-
/= (compound division)
Data Type: # void
- boolean
- char
- unsigned char
- byte
- int
- unsigned int
- word
- long
- unsigned long
- float
- double
- string
- array
Constants: # HIGH | LOW ( Digital I/O level, HIGH for 1, LOW for 0)
- INPUT | OUTPUT (Digital I/O direction)
- true | false (true for 1, false for 0)
Above are the basic key word and syntax for Arduino C language. After some reading, users are supposed to be qualified for the simple programming on Arduino platform. Structure: # void setup() (Initialize variables, Digital I/O, libraries, etc)
- void loop() (execute loop)
Digital I/O: # pinMode(pin, mode) (Digital I/O input/output mode define function. pin:0 ~ 13, mode : INPUT, OUTPUT)
- digitalWrite(pin, value) (Digital I/O output value define function. pin: 0 ~ 13, value: HIGH or LOW)
- int digitalRead(pin) (Digital I/O input read function. pin: 0 ~ 13)
Analog I/O: # int analogRead(pin) (Analog I/O input read function. pin: 0 ~ 5, 0 ~ 1023 stands for 0 ~ 5V)
- analogWrite(pin, value) - PWM
Time: # delay(ms) (delay function, unit: ms)
- delayMicroseconds(us) (delay functions, unit: us)
Math: # min(x, y) (return minimum value of x and y)
- max(x, y) (return maximum value of x and y)
- abs(x) (return absolute value of x)
- constrain(x, a, b) (return only if x is between lower bound a and upper bound b)
- map(value, fromLow, fromHigh, toLow, toHigh) (return only if value is between fromLow to fromHigh, or toLow to toHigh)
- pow(base, exponent) (return the exponent of base)
- sqrt(x) (return square root of x)
Component List # Arduino 328 × 1