Title: ??????????(1/3) Arduino Programming Language
1??????????(1/3)Arduino Programming Language
- Chin-Shiuh Shieh (???)
- http//bit.kuas.edu.tw/csshieh
- Department of Electronic Engineering
- National Kaohsiung University of Applied
Sciences, Taiwan
2Arduino Programming Language
- Arduino Tutorials
- http//arduino.cc/en/Tutorial/HomePage
- Arduino - Reference
- http//arduino.cc/en/Reference/HomePage
- Arduino Libraries
- http//arduino.cc/en/Reference/Libraries
3Structure
4Structure - Control Structures
- if
- if...else
- for
- switch case
- while
- do... while
- break
- continue
- return
- goto
5Structure - Further Syntax
- (semicolon)
- (curly braces)
- // (single line comment)
- / / (multi-line comment)
- define
- include
6Structure - Arithmetic Operators
- (assignment operator)
- (addition)
- - (subtraction)
- (multiplication)
- / (division)
- (modulo)
7Structure - Comparison Operators
- (equal to)
- ! (not equal to)
- lt (less than)
- gt (greater than)
- lt (less than or equal to)
- gt (greater than or equal to)
8Structure - Boolean Operators
9Structure - Pointer Access Operators
- dereference operator
- reference operator
10Structure - Bitwise Operators
- (bitwise and)
- (bitwise or)
- (bitwise xor)
- (bitwise not)
- ltlt (bitshift left)
- gtgt (bitshift right)
11Structure - Compound Operators
- (increment)
- -- (decrement)
- (compound addition)
- - (compound subtraction)
- (compound multiplication)
- / (compound division)
- (compound bitwise and)
- (compound bitwise or)
12Variables - Constants
- HIGH LOW
- INPUT OUTPUT INPUT_PULLUP
- true false
- integer constants
- floating point constants
13Variables - Data Types
- void
- boolean
- char
- unsigned char
- byte
- int
- unsigned int
- word
- long
- unsigned long
- float
- double
- string - char array
- String - object
- array
14Variables - Conversion
- char()
- byte()
- int()
- word()
- long()
- float()
15Variables - Variable Scope Qualifiers
- variable scope
- static
- volatile
- const
16Variables - Utilities
17Functions - Digital I/O
- pinMode()
- digitalWrite()
- digitalRead()
18Functions - Analog I/O
- analogReference()
- analogRead()
- analogWrite() - PWM
19Functions - Advanced I/O
- tone()
- noTone()
- shiftOut()
- shiftIn()
- pulseIn()
- pulseIn(2,HIGH)
20Functions - Time
- millis()
- micros()
- delay()
- delayMicroseconds()
21Functions - Math
- min()
- max()
- abs()
- constrain()
- map()
- pow()
- sqrt()
22Functions - Trigonometry
23Functions - Random Numbers
24Functions - Bits and Bytes
- lowByte()
- highByte()
- bitRead()
- bitWrite()
- bitSet()
- bitClear()
- bit()
25Functions - External Interrupts
- attachInterrupt()
- detachInterrupt()
26Functions - Interrupts
- interrupts()
- noInterrupts()
27Functions - Communication