Presentation is loading. Please wait.

Presentation is loading. Please wait.

Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (1/3) Arduino Programming Language Chin-Shiuh Shieh ( 謝欽旭 ) Department.

Similar presentations


Presentation on theme: "Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (1/3) Arduino Programming Language Chin-Shiuh Shieh ( 謝欽旭 ) Department."— Presentation transcript:

1 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (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 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan2 Arduino Programming Language Arduino – Tutorials –http://arduino.cc/en/Tutorial/HomePagehttp://arduino.cc/en/Tutorial/HomePage Arduino - Reference –http://arduino.cc/en/Reference/HomePagehttp://arduino.cc/en/Reference/HomePage Arduino – Libraries –http://arduino.cc/en/Reference/Librarieshttp://arduino.cc/en/Reference/Libraries

3 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan3 Structure setup() loop()

4 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan4 Structure - Control Structures if if...else for switch case while do... while break continue return goto

5 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan5 Structure - Further Syntax ; (semicolon) {} (curly braces) // (single line comment) /* */ (multi-line comment) #define #include

6 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan6 Structure - Arithmetic Operators = (assignment operator) + (addition) - (subtraction) * (multiplication) / (division) % (modulo)

7 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan7 Structure - Comparison Operators == (equal to) != (not equal to) < (less than) > (greater than) <= (less than or equal to) >= (greater than or equal to)

8 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan8 Structure - Boolean Operators && (and) || (or) ! (not)

9 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan9 Structure - Pointer Access Operators * dereference operator & reference operator

10 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan10 Structure - Bitwise Operators & (bitwise and) | (bitwise or) ^ (bitwise xor) ~ (bitwise not) << (bitshift left) >> (bitshift right)

11 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan11 Structure - Compound Operators ++ (increment) -- (decrement) += (compound addition) -= (compound subtraction) *= (compound multiplication) /= (compound division) &= (compound bitwise and) |= (compound bitwise or)

12 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan12 Variables - Constants HIGH | LOW INPUT | OUTPUT| INPUT_PULLUP true | false integer constants floating point constants

13 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan13 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 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan14 Variables - Conversion char() byte() int() word() long() float()

15 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan15 Variables - Variable Scope & Qualifiers variable scope static volatile const

16 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan16 Variables - Utilities sizeof()

17 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan17 Functions - Digital I/O pinMode() digitalWrite() digitalRead()

18 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan18 Functions - Analog I/O analogReference() analogRead() analogWrite() - PWM

19 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan19 Functions - Advanced I/O tone() noTone() shiftOut() shiftIn() pulseIn() pulseIn(2,HIGH);

20 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan20 Functions - Time millis() micros() delay() delayMicroseconds()

21 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan21 Functions - Math min() max() abs() constrain() map() pow() sqrt()

22 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan22 Functions - Trigonometry sin() cos() tan()

23 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan23 Functions - Random Numbers randomSeed() random()

24 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan24 Functions - Bits and Bytes lowByte() highByte() bitRead() bitWrite() bitSet() bitClear() bit()

25 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan25 Functions - External Interrupts attachInterrupt() detachInterrupt()

26 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan26 Functions - Interrupts interrupts() noInterrupts()

27 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan27 Functions - Communication Serial Stream


Download ppt "Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (1/3) Arduino Programming Language Chin-Shiuh Shieh ( 謝欽旭 ) Department."

Similar presentations


Ads by Google