EasyManuals Logo

Arduino uno User Guide

Arduino uno
27 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #17 background imageLoading...
Page #17 background image
17
100
0x64
B01100100
Labels are used to reference locations in your program. They can be any combination of letters,
numbers and underscore (_), but the first character must be a letter. When used to mark a
location, follow the label with a colon. When referring to an address label in an instruction line,
don't use the colon. Here's an example
repeat: digitalWrite(2,HIGH);
delay(1000);
digitalWrite(2,LOW);
delay(1000);
goto repeat;
Use labels sparingly as they can actually make a program difficult to follow and challenging to
debug. In fact, some C programmers will tell you to never use labels.
Variables are allocated by declaring them in the program. Every variable must be declared. If a
variable is declared outside the braces of a function, it can be seen everywhere in the program. If
it is declared inside the braces of a function, the variable can only be seen within that function.
Variables come in several flavors including byte (8-bit, unsigned, 0 to 255), word (16-bit,
unsigned, 0 to 65,536), int (16-bit, signed, -32,768 to 32,767), and long (32-bit,
signed, -2,147,483,648 to 2,147,483,647). Use byte variables unless you need negative numbers
or numbers larger than 255, then use int variables. Using larger sizes than needed fills up
precious memory space.
Variable declarations generally appear at the top of the program
byte i;
word k;
int length;
int width;
Variable names can be any combination of letters and numbers but must start with a letter.
Names reserved for programming instructions cannot be used for variable names and will give
you an error message
Symbols are used to redefine how something is named and can be handy for making the code
more readable. Symbols are defined with the "#define" command and lines defining symbols
should go at the beginning of your program. Here's an example without symbols for the case
where an LED is connected to pin 2.
void setup()
{
pinMode(2,OUTPUT);
}
void loop()
{
digitalWrite(2,HIGH); // turn LED on

Other manuals for Arduino uno

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Arduino uno and is the answer not in the manual?

Arduino uno Specifications

General IconGeneral
Form factorArduino
CertificationRoHS, FC, CE
Processor model-
Processor frequency- MHz
Microcontroller modelATmega328
Microcontroller frequency16 MHz
DC input voltage7-12 V
Operating voltage5 V
DC current per I/O pin40 mA
Flash memory0.032 MB
Maximum internal memory- GB
SRAM (Static Random Access Memory)2 KB
EEPROM (Electrically Erasable Programmable Read-Only Memory)1 KB
Wi-FiNo
Number of analog I/O pins6
Number of digital I/O pins14
Weight and Dimensions IconWeight and Dimensions
Board dimensions53.4 x 68.6 mm

Related product manuals