??????????(1/3) Arduino Programming Language - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

??????????(1/3) Arduino Programming Language

Description:

(1/3) Arduino Programming Language Chin-Shiuh Shieh ( ) http://bit.kuas.edu.tw/~csshieh Department of Electronic Engineering – PowerPoint PPT presentation

Number of Views:311
Avg rating:3.0/5.0
Slides: 28
Provided by: ChinShi2
Category:

less

Transcript and Presenter's Notes

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

2
Arduino 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

3
Structure
  • setup()
  • loop()

4
Structure - Control Structures
  • if
  • if...else
  • for
  • switch case
  • while
  • do... while
  • break
  • continue
  • return
  • goto

5
Structure - Further Syntax
  • (semicolon)
  • (curly braces)
  • // (single line comment)
  • / / (multi-line comment)
  • define
  • include

6
Structure - Arithmetic Operators
  • (assignment operator)
  • (addition)
  • - (subtraction)
  • (multiplication)
  • / (division)
  • (modulo)

7
Structure - 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)

8
Structure - Boolean Operators
  • (and)
  • (or)
  • ! (not)

9
Structure - Pointer Access Operators
  • dereference operator
  • reference operator

10
Structure - Bitwise Operators
  • (bitwise and)
  • (bitwise or)
  • (bitwise xor)
  • (bitwise not)
  • ltlt (bitshift left)
  • gtgt (bitshift right)

11
Structure - Compound Operators
  • (increment)
  • -- (decrement)
  • (compound addition)
  • - (compound subtraction)
  • (compound multiplication)
  • / (compound division)
  • (compound bitwise and)
  • (compound bitwise or)

12
Variables - Constants
  • HIGH LOW
  • INPUT OUTPUT INPUT_PULLUP
  • true false
  • integer constants
  • floating point constants

13
Variables - Data Types
  • void
  • boolean
  • char
  • unsigned char
  • byte
  • int
  • unsigned int
  • word
  • long
  • unsigned long
  • float
  • double
  • string - char array
  • String - object
  • array

14
Variables - Conversion
  • char()
  • byte()
  • int()
  • word()
  • long()
  • float()

15
Variables - Variable Scope Qualifiers
  • variable scope
  • static
  • volatile
  • const

16
Variables - Utilities
  • sizeof()

17
Functions - Digital I/O
  • pinMode()
  • digitalWrite()
  • digitalRead()

18
Functions - Analog I/O
  • analogReference()
  • analogRead()
  • analogWrite() - PWM

19
Functions - Advanced I/O
  • tone()
  • noTone()
  • shiftOut()
  • shiftIn()
  • pulseIn()
  • pulseIn(2,HIGH)

20
Functions - Time
  • millis()
  • micros()
  • delay()
  • delayMicroseconds()

21
Functions - Math
  • min()
  • max()
  • abs()
  • constrain()
  • map()
  • pow()
  • sqrt()

22
Functions - Trigonometry
  • sin()
  • cos()
  • tan()

23
Functions - Random Numbers
  • randomSeed()
  • random()

24
Functions - Bits and Bytes
  • lowByte()
  • highByte()
  • bitRead()
  • bitWrite()
  • bitSet()
  • bitClear()
  • bit()

25
Functions - External Interrupts
  • attachInterrupt()
  • detachInterrupt()

26
Functions - Interrupts
  • interrupts()
  • noInterrupts()

27
Functions - Communication
  • Serial
  • Stream
Write a Comment
User Comments (0)
About PowerShow.com