Lecture 3
Lecture 3
Lecture 3
Arduino Overview II
Arduino Overview II
• Programming IDE!
• Serial Communications
• In this class, it is
assumed that you have
a working knowledge of
C
http://wuweida.u.qiniudn.com/C%20Primer%20Plus%205th%20Edition(ENG).pdf
EE 260 Lecture 3: Arduino Overview II
Simplest Program: Do Nothing
void
setup()
{
}
void
loop()
{
}
Click on the !
Reference!
tab.
Digital:
HIGH
|
LOW (logic level)
true
|
false (boolean)
GPIO Configuration:
INPUT
|
OUTPUT
|
INPUT_PULLUP
Numeric:
Integer: B11010101,
-‐123,
123uL,
0x3C,
0123
Float: -‐1.2,
1.7e5,
-‐62E-‐12
EE 260 Lecture 3: Arduino Overview II
Arduino IDE: Data Types
C C C C
INPUT
OUTPUT
pinMode tone analogReference
INPUT_PULLUP 0,1,2,3,4,5,6,7,8,9,10,11,12,13, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,
A0,A1,A2,A3,A4,A5 A0,A1,A2,A3,A4,A5
HIGH
LOW digitalWrite noTone analogRead
0,1,2,3,4,5,6,7,8,9,10,11,12,13, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,
A0,A1,A2,A3,A4,A5 A0,A1,A2,A3,A4,A5 A0,A1,A2,A3,A4,A5
HIGH
LOW digitalRead pulseIn analogWrite
0,1,2,3,4,5,6,7,8,9,10,11,12,13, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,
A0,A1,A2,A3,A4,A5 A0,A1,A2,A3,A4,A5 A0,A1,A2,A3,A4,A5
• attachInterrupt
• detachInterrupt
!
• interrupts()
• noInterrupts()
• shiftOut
• shiftIn
• Serial
+ != || | -‐-‐
-‐ < ! ^ +=
* > ~ -‐=
• if...else • break
• for • continue
• while • goto