Arduino Programming: Comments, Operators, Variables, and Control Structures, Slides of Electronics

An overview of the arduino programming environment, focusing on comments, operators, variables, and control structures. It covers the use of comments, operators such as equals sign, and, or, declaring and assigning variables of different types, variable scope, and control structures like if statements and basic repetition. It also introduces the setup function and interrupts.

Typology: Slides

2013/2014

Uploaded on 01/31/2014

roel.edeleon
roel.edeleon 🇵🇭

2 documents

1 / 53

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Arduino Programming Section
http://arduino.cc/en/Reference/HomePage
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35

Partial preview of the text

Download Arduino Programming: Comments, Operators, Variables, and Control Structures and more Slides Electronics in PDF only on Docsity!

Arduino Programming Section http://arduino.cc/en/Reference/HomePage

The Arduino Environment

Serial Port / COM Port

The Environment

Comments

  • (^) Comments can be anywhere

Comments

  • (^) Comments can be anywhere
  • (^) Comments created with // or /* and */

Comments

  • (^) Comments can be anywhere
  • (^) Comments created with // or /* and */
  • (^) Comments do not affect code
  • (^) You may not need comments, but think about the community!

Operators

The equals sign = is used to assign a value == is used to compare values

Variables

Basic variable types: Boolean Integer Character

Declaring Variables

Boolean: boolean variableName;

Declaring Variables

Boolean: boolean variableName; Integer: int variableName; Character: char variableName;

Declaring Variables

Boolean: boolean variableName; Integer: int variableName; Character: char variableName; String: stringName [ ];

Assigning Variables

Boolean: variableName = true; or variableName = false; Integer: variableName = 32767; or variableName = -32768;

Assigning Variables

Boolean: variableName = true; or variableName = false; Integer: variableName = 32767; or variableName = -32768; Character: variableName = ‘A’; or stringName = “SparkFun”;