User manual

www.sainsmart.com
Copyright © 2013 SainSmart All Rights Reserved
>=
&&
||
!
Data type
boolean
char
byte
int
unsigned int
long
unsigned long
float
double
string
array
void
Constant
HIGH | LOW Said digital IO port level, HIGH Said high level(1), LOW Said low electric
flat(0).
INPUT | OUTPUT Said digital IO port direction, INPUT Said input (high impedance state)
OUTPUT Said output (AVR can provide 5 v voltage and ma current).
TURE | FALSE true(1) , false(0.
All above are the basic c grammar words and symbols, everybody can understand, and the
specific use can combine experimental procedure.
Structure
void setup()
The setup() function is called when a sketch starts. Use it to initialize variables, pin modes, start
using libraries, etc. The setup function will only run once, after each power up or reset of the
Arduino board.
void loop()
After creating a setup() function, which initializes and sets the initial values, the loop() function
does precisely what its name suggests, and loops consecutively, allowing your program to change
and respond. Use it to actively control the Arduino board.
Function
Digital I/O
pinMode(pin, mode) pin 0~13, mode is input or output.
digitalWrite(pin, value) pin 0~13, value is HIGH or LOW.
int digitalRead(pin) pin 0~13, value is HIGH or LOW.