0% found this document useful (0 votes)
3 views

Arduino Class

The document outlines the basic structure of an Arduino program, which consists of the void setup and void loop functions. It explains basic syntax elements such as comments, semi-colons, and braces, as well as introduces variables and data types like int, float, strings, and boolean. Additionally, it describes fundamental Arduino functions like pinMode, digitalWrite, analogWrite, and delay.

Uploaded by

gyandaniel599
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Arduino Class

The document outlines the basic structure of an Arduino program, which consists of the void setup and void loop functions. It explains basic syntax elements such as comments, semi-colons, and braces, as well as introduces variables and data types like int, float, strings, and boolean. Additionally, it describes fundamental Arduino functions like pinMode, digitalWrite, analogWrite, and delay.

Uploaded by

gyandaniel599
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ARDUINO CLASS

Basic structure of an Arduino code


An Arduino program has two main functions
1. The void setup function
2. The void loop function
The void setup function runs once when the Arduino is powered or reset. It is
used to initialize settings like pinMode, Serial communication, etc.
The void loop function runs continuously until the Arduino is turned off. It
contains the main code that controls the board.

UNDERSTANDING THE BASIC SYNTAX


1. Comments ; They are used to explain code. They are ignored by the
compiler
//This is a single-line comment
/This is a multi-line comment*/

2. Semi-colon ; It marks the end of a statement .

3. Braces{} ; It groups multiple statements together especially in functions or


loops.

VARIABLES AND DATA TYPES


• Int
• Float
• Strings
• Boolean
BASIC ARDUINO FUNCTIONS
pinMode() ; It configures a pin as input or output eg. pinMode(5, OUTPUT)
digitalWrite() ; It sends high or low to a pin eg. digitalWrite(5, HIGH)
analogWrite() ; It sends analog values to a pin
delay() ; It pauses the program for a specified time in milliseconds

You might also like