SlideShare a Scribd company logo
1 of 28
Download to read offline
Team Emertxe
Arduino
Classes and Functions
Classes
Arduino
Class – What?
A set or category of things having some property or attribute in
common and differentiated from others by kind, type, or quality.
Source: google
Template definition of the methods and variables
in a particular kind of object
Source: google
Arduino
Class – Why?
●
A technique which helps to describe the object
completely from properties to its implementation
●
Acts as blue print, which helps us to create objects of the
same type!.
●
What do you understand from the image put in the next
slide?
Arduino
Class – Why?
Arduino
Class – Why?
●
What is to be understood here is the blueprint of bicycle
will always be same, like its going to have 2 tiers, a seat,
a handle etc.,
●
We may create different types of bicycles with a defined
class
Arduino
Class – Where?
●
Since Arduino is a open source platform, there many
classes available to use.
●
More information regarding these function can be
obtained in link given below
https://www.arduino.cc/reference/en/#functions
Communication
Arduino
Classes – Communication – Serial.begin()
Description Sets the data rate in bits per second (baud) for serial data
transmission
Syntax Serial.begin(speed)
Serial.begin(speed, config)
Parameters speed: in bits per second (baud) – long
config: sets data, parity, and stop bits. Some valid values are
SERIAL_5N1
SERIAL_6N1
SERIAL_7N1
SERIAL_8N1 (the default)
Return Nothing
Arduino
Classes – Communication - Serial.print()
Description Prints data to the serial port as human-readable ASCII text. This
command can take many forms. Numbers are printed using an
ASCII character for each digit.
Syntax Serial.print(val)
Serial.print(val, format)
Parameters val: the value to print - any data type
format: specifies the number base (for integral data types) or
number of decimal places (for floating point types)
Return size_t: print() returns the number of bytes written, though
reading that number is optional.
Example Serial.print(78) gives "78"
Serial.print(1.23456) gives "1.23"
Serial.print('N') gives "N"
Serial.print("Hello world.") gives "Hello world."
Serial.print(78, BIN) gives "1001110" where BIN
can be replaced with OCT, DEC or HEX
Serial.print(1.23456, 0) gives "1"
Serial.print(1.23456, 2) gives "1.23"
Arduino
Classes – Communication - Serial.println()
Description Prints data to the serial port as human-readable ASCII text
followed by a carriage return character (ASCII 13, or 'r') and a
newline character (ASCII 10, or 'n'). This command takes the same
forms as Serial.print().
Syntax Serial.println(val)
Serial.println(val, format)
Parameters val: the value to print - any data type
format: specifies the number base (for integral data types) or
number of decimal places (for floating point types)
Return size_t: println() returns the number of bytes written,
though reading that number is optional.
Arduino
Classes – Communication - Serial.write()
Description Writes binary data to the serial port. This data is sent as a byte or
series of bytes; to send the characters representing the digits of a
number use the print() function instead.
Syntax Serial.write(val)
Serial.write(str)
Serial.write(buf, len)
Parameters val: a value to send as a single byte
str: a string to send as a series of bytes
buf: an array to send as a series of bytes
Return size_t: write() will return the number of bytes written,
though reading that number is optional
Arduino
Classes – Communication - Serial.read()
Description Reads incoming serial data. read() inherits from the Stream utility
class.
Syntax Serial.read()
Parameters Nothing
Return The first byte of incoming serial data available (or -1 if no data is
available) - int.
Arduino
Classes – Communication - Serial
Want to more on Serial functions?
Click the below link
Digital I/O
Arduino
Classes – Digital I/O - pinMode()
Description Configures the specified pin to behave either as an input or an
output
Syntax pinMode(pin, mode)
Parameters pin: the number of the pin whose mode you wish to set
mode: INPUT, OUTPUT, or INPUT_PULLUP. (see the (digital pins)
page for a more complete description of the functionality.)
Return Nothing
Notes and
Warnings
The analog input pins can be used as digital pins, referred to as
A0, A1, etc.
Arduino
Classes – Digital I/O - digitalWrite()
Description Write a HIGH or a LOW value to a digital pin.
Syntax digitalWrite(pin, value)
Parameters pin: the pin number
value: HIGH or LOW
Return Nothing
Arduino
Classes – Digital I/O - digitalRead()
Description Reads the value from a specified digital pin, either HIGH or LOW.
Syntax digitalRead(pin)
Parameters pin: the number of the digital pin you want to read
Return HIGH or LOW
Time
Arduino
Classes – Time - delay()
Description Pauses the program for the amount of time (in milliseconds)
specified as parameter. (There are 1000 milliseconds in a second.)
Syntax delay(ms)
Parameters ms: the number of milliseconds to pause (unsigned long)
Return Nothing
Arduino
Classes – Time - delayMicroseconds()
Description Pauses the program for the amount of time (in microseconds)
specified as parameter. There are a thousand microseconds in a
millisecond, and a million microseconds in a second.
Currently, the largest value that will produce an accurate delay is
16383
Syntax delayMicroseconds(us)
Parameters us: the number of microseconds to pause (unsigned int)
Return Nothing
Arduino
Classes – Time - micros()
Description Returns the number of microseconds since the Arduino board
began running the current program. This number will overflow (go
back to zero), after approximately 70 minutes.
Syntax time = micros()
Parameters Nothing
Return Returns the number of microseconds since the Arduino board
began running the current program.(unsigned long)
Arduino
Classes – Time - millis()
Description Returns the number of milliseconds since the Arduino board began
running the current program. This number will overflow (go back
to zero), after approximately 50 days.
Syntax time = millis()
Parameters Nothing
Return Number of milliseconds since the program started (unsigned long)
Notes and
Warnings
Please note that the return value for millis() is an unsigned long,
logic errors may occur if a programmer tries to do arithmetic with
smaller data types such as int’s. Even signed long may encounter
errors as its maximum value is half that of its unsigned
counterpart.
Analog I/O
Arduino
Classes – Analog I/O - analogRead()
Description Reads the value from the specified analog pin. The number of
channels depends on the board used, assuming 10-bit analog to
digital converter, mapping voltages between 0 and 5 volts into
integer values between 0 and 1023. This yields a resolution
between readings of: 5 volts / 1024 units or, .0049 volts (4.9 mV)
per unit. The input range and resolution can be changed using
analogReference().
It takes about 100 microseconds to read an analog input,
Syntax val = analogRead(pin)
Parameters pin: the number of the analog input pin to read from
Return int (0 to 1023) Depends on the board
Notes and
Warnings
If the analog input pin is not connected to anything, the value
returned by analogRead() will fluctuate based on a number of
factors (e.g. the values of the other analog inputs, how close your
hand is to the board, etc.).
Arduino
Classes – Analog I/O - analogWrite()
Description Writes an analog value (PWM wave) to a pin. Can be used to light a
LED at varying brightnesses or drive a motor at various speeds
Syntax analogWrite(pin, value)
Parameters pin: the pin to write to. Allowed data types: int.
value: the duty cycle: between 0 (always off) and 255 (always
on). Allowed data types: int
Return Nothing
Notes and
Warnings
Please click on the below link icon for more info
Arduino
Classes – Analog I/O - analogWrite()
Description Configures the reference voltage used for analog input (i.e. the
value used as the top of the input range)
Syntax analogReference(type)
Parameters type: which type of reference to use (see list of options in the
description).
Return Nothing
Notes and
Warnings
Please click on the below link icon for more info
Thank You

More Related Content

What's hot

Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoVishnu
 
Blinking a Single LED
Blinking a Single LEDBlinking a Single LED
Blinking a Single LEDRihab Rahman
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshopatuline
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYVishnu
 
Arduino Introduction (Blinking LED) Presentation (workshop #5)
Arduino  Introduction (Blinking LED)  Presentation (workshop #5)Arduino  Introduction (Blinking LED)  Presentation (workshop #5)
Arduino Introduction (Blinking LED) Presentation (workshop #5)UNCG University Libraries
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriGaurav Pandey
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the ArduinoWingston
 
Microchip's PIC Micro Controller
Microchip's PIC Micro ControllerMicrochip's PIC Micro Controller
Microchip's PIC Micro ControllerMidhu S V Unnithan
 
I o ports and timers of 8051
I o ports and timers of 8051I o ports and timers of 8051
I o ports and timers of 8051SARITHA REDDY
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATIONsoma saikiran
 
sequential circuits
sequential circuitssequential circuits
sequential circuitsUnsa Shakir
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduinoavikdhupar
 
Introducing the Arduino
Introducing the ArduinoIntroducing the Arduino
Introducing the ArduinoCharles A B Jr
 
Serial Communication Interfaces
Serial Communication InterfacesSerial Communication Interfaces
Serial Communication Interfacesanishgoel
 

What's hot (20)

Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
 
Arduino Functions
Arduino FunctionsArduino Functions
Arduino Functions
 
Blinking a Single LED
Blinking a Single LEDBlinking a Single LED
Blinking a Single LED
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIY
 
Arduino Uno Pin Description
Arduino Uno Pin DescriptionArduino Uno Pin Description
Arduino Uno Pin Description
 
Arduino Introduction (Blinking LED) Presentation (workshop #5)
Arduino  Introduction (Blinking LED)  Presentation (workshop #5)Arduino  Introduction (Blinking LED)  Presentation (workshop #5)
Arduino Introduction (Blinking LED) Presentation (workshop #5)
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 
PAL And PLA ROM
PAL And PLA ROMPAL And PLA ROM
PAL And PLA ROM
 
Microchip's PIC Micro Controller
Microchip's PIC Micro ControllerMicrochip's PIC Micro Controller
Microchip's PIC Micro Controller
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Aurdino presentation
Aurdino presentationAurdino presentation
Aurdino presentation
 
I o ports and timers of 8051
I o ports and timers of 8051I o ports and timers of 8051
I o ports and timers of 8051
 
Lpc 17xx adc
Lpc 17xx adcLpc 17xx adc
Lpc 17xx adc
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATION
 
sequential circuits
sequential circuitssequential circuits
sequential circuits
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Introducing the Arduino
Introducing the ArduinoIntroducing the Arduino
Introducing the Arduino
 
Serial Communication Interfaces
Serial Communication InterfacesSerial Communication Interfaces
Serial Communication Interfaces
 

Similar to Arduino - Classes and functions

Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docxAjay578679
 
arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfssusere5db05
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseElaf A.Saeed
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينوsalih mahmod
 
Embedded systems optimization memory requirments.pptx
Embedded systems optimization memory requirments.pptxEmbedded systems optimization memory requirments.pptx
Embedded systems optimization memory requirments.pptxsatheeshKumar750
 
[Apostila] programação arduíno brian w. evans
[Apostila] programação arduíno   brian w. evans[Apostila] programação arduíno   brian w. evans
[Apostila] programação arduíno brian w. evansWeb-Desegner
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming FamiliarizationAmit Kumer Podder
 
After COMPUTING THIS IS FOR COMPUTER SCIENTISTS.pptx
After COMPUTING THIS IS FOR COMPUTER SCIENTISTS.pptxAfter COMPUTING THIS IS FOR COMPUTER SCIENTISTS.pptx
After COMPUTING THIS IS FOR COMPUTER SCIENTISTS.pptxElisée Ndjabu
 
Arduino by yogesh t s'
Arduino by yogesh t s'Arduino by yogesh t s'
Arduino by yogesh t s'tsyogesh46
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 PresentationYogendra Tamang
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3Jeni Shah
 
Ch_2_8,9,10.pptx
Ch_2_8,9,10.pptxCh_2_8,9,10.pptx
Ch_2_8,9,10.pptxyosikit826
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 

Similar to Arduino - Classes and functions (20)

Arduino reference
Arduino referenceArduino reference
Arduino reference
 
AVR arduino dasar
AVR arduino dasarAVR arduino dasar
AVR arduino dasar
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 
Arduino: Arduino starter kit
Arduino: Arduino starter kitArduino: Arduino starter kit
Arduino: Arduino starter kit
 
Arduino and Circuits.docx
Arduino and Circuits.docxArduino and Circuits.docx
Arduino and Circuits.docx
 
arduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdfarduinocourse-180308074529 (1).pdf
arduinocourse-180308074529 (1).pdf
 
Arduino course
Arduino courseArduino course
Arduino course
 
Arduino programming
Arduino programmingArduino programming
Arduino programming
 
Lecture6
Lecture6Lecture6
Lecture6
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
Embedded systems optimization memory requirments.pptx
Embedded systems optimization memory requirments.pptxEmbedded systems optimization memory requirments.pptx
Embedded systems optimization memory requirments.pptx
 
[Apostila] programação arduíno brian w. evans
[Apostila] programação arduíno   brian w. evans[Apostila] programação arduíno   brian w. evans
[Apostila] programação arduíno brian w. evans
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
 
After COMPUTING THIS IS FOR COMPUTER SCIENTISTS.pptx
After COMPUTING THIS IS FOR COMPUTER SCIENTISTS.pptxAfter COMPUTING THIS IS FOR COMPUTER SCIENTISTS.pptx
After COMPUTING THIS IS FOR COMPUTER SCIENTISTS.pptx
 
Arduino by yogesh t s'
Arduino by yogesh t s'Arduino by yogesh t s'
Arduino by yogesh t s'
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
 
Ch_2_8,9,10.pptx
Ch_2_8,9,10.pptxCh_2_8,9,10.pptx
Ch_2_8,9,10.pptx
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 

More from Emertxe Information Technologies Pvt Ltd

More from Emertxe Information Technologies Pvt Ltd (20)

premium post (1).pdf
premium post (1).pdfpremium post (1).pdf
premium post (1).pdf
 
Career Transition (1).pdf
Career Transition (1).pdfCareer Transition (1).pdf
Career Transition (1).pdf
 
10_isxdigit.pdf
10_isxdigit.pdf10_isxdigit.pdf
10_isxdigit.pdf
 
01_student_record.pdf
01_student_record.pdf01_student_record.pdf
01_student_record.pdf
 
02_swap.pdf
02_swap.pdf02_swap.pdf
02_swap.pdf
 
01_sizeof.pdf
01_sizeof.pdf01_sizeof.pdf
01_sizeof.pdf
 
07_product_matrix.pdf
07_product_matrix.pdf07_product_matrix.pdf
07_product_matrix.pdf
 
06_sort_names.pdf
06_sort_names.pdf06_sort_names.pdf
06_sort_names.pdf
 
05_fragments.pdf
05_fragments.pdf05_fragments.pdf
05_fragments.pdf
 
04_magic_square.pdf
04_magic_square.pdf04_magic_square.pdf
04_magic_square.pdf
 
03_endianess.pdf
03_endianess.pdf03_endianess.pdf
03_endianess.pdf
 
02_variance.pdf
02_variance.pdf02_variance.pdf
02_variance.pdf
 
01_memory_manager.pdf
01_memory_manager.pdf01_memory_manager.pdf
01_memory_manager.pdf
 
09_nrps.pdf
09_nrps.pdf09_nrps.pdf
09_nrps.pdf
 
11_pangram.pdf
11_pangram.pdf11_pangram.pdf
11_pangram.pdf
 
10_combinations.pdf
10_combinations.pdf10_combinations.pdf
10_combinations.pdf
 
08_squeeze.pdf
08_squeeze.pdf08_squeeze.pdf
08_squeeze.pdf
 
07_strtok.pdf
07_strtok.pdf07_strtok.pdf
07_strtok.pdf
 
06_reverserec.pdf
06_reverserec.pdf06_reverserec.pdf
06_reverserec.pdf
 
05_reverseiter.pdf
05_reverseiter.pdf05_reverseiter.pdf
05_reverseiter.pdf
 

Recently uploaded

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Recently uploaded (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Arduino - Classes and functions

  • 3. Arduino Class – What? A set or category of things having some property or attribute in common and differentiated from others by kind, type, or quality. Source: google Template definition of the methods and variables in a particular kind of object Source: google
  • 4. Arduino Class – Why? ● A technique which helps to describe the object completely from properties to its implementation ● Acts as blue print, which helps us to create objects of the same type!. ● What do you understand from the image put in the next slide?
  • 6. Arduino Class – Why? ● What is to be understood here is the blueprint of bicycle will always be same, like its going to have 2 tiers, a seat, a handle etc., ● We may create different types of bicycles with a defined class
  • 7. Arduino Class – Where? ● Since Arduino is a open source platform, there many classes available to use. ● More information regarding these function can be obtained in link given below https://www.arduino.cc/reference/en/#functions
  • 9. Arduino Classes – Communication – Serial.begin() Description Sets the data rate in bits per second (baud) for serial data transmission Syntax Serial.begin(speed) Serial.begin(speed, config) Parameters speed: in bits per second (baud) – long config: sets data, parity, and stop bits. Some valid values are SERIAL_5N1 SERIAL_6N1 SERIAL_7N1 SERIAL_8N1 (the default) Return Nothing
  • 10. Arduino Classes – Communication - Serial.print() Description Prints data to the serial port as human-readable ASCII text. This command can take many forms. Numbers are printed using an ASCII character for each digit. Syntax Serial.print(val) Serial.print(val, format) Parameters val: the value to print - any data type format: specifies the number base (for integral data types) or number of decimal places (for floating point types) Return size_t: print() returns the number of bytes written, though reading that number is optional. Example Serial.print(78) gives "78" Serial.print(1.23456) gives "1.23" Serial.print('N') gives "N" Serial.print("Hello world.") gives "Hello world." Serial.print(78, BIN) gives "1001110" where BIN can be replaced with OCT, DEC or HEX Serial.print(1.23456, 0) gives "1" Serial.print(1.23456, 2) gives "1.23"
  • 11. Arduino Classes – Communication - Serial.println() Description Prints data to the serial port as human-readable ASCII text followed by a carriage return character (ASCII 13, or 'r') and a newline character (ASCII 10, or 'n'). This command takes the same forms as Serial.print(). Syntax Serial.println(val) Serial.println(val, format) Parameters val: the value to print - any data type format: specifies the number base (for integral data types) or number of decimal places (for floating point types) Return size_t: println() returns the number of bytes written, though reading that number is optional.
  • 12. Arduino Classes – Communication - Serial.write() Description Writes binary data to the serial port. This data is sent as a byte or series of bytes; to send the characters representing the digits of a number use the print() function instead. Syntax Serial.write(val) Serial.write(str) Serial.write(buf, len) Parameters val: a value to send as a single byte str: a string to send as a series of bytes buf: an array to send as a series of bytes Return size_t: write() will return the number of bytes written, though reading that number is optional
  • 13. Arduino Classes – Communication - Serial.read() Description Reads incoming serial data. read() inherits from the Stream utility class. Syntax Serial.read() Parameters Nothing Return The first byte of incoming serial data available (or -1 if no data is available) - int.
  • 14. Arduino Classes – Communication - Serial Want to more on Serial functions? Click the below link
  • 16. Arduino Classes – Digital I/O - pinMode() Description Configures the specified pin to behave either as an input or an output Syntax pinMode(pin, mode) Parameters pin: the number of the pin whose mode you wish to set mode: INPUT, OUTPUT, or INPUT_PULLUP. (see the (digital pins) page for a more complete description of the functionality.) Return Nothing Notes and Warnings The analog input pins can be used as digital pins, referred to as A0, A1, etc.
  • 17. Arduino Classes – Digital I/O - digitalWrite() Description Write a HIGH or a LOW value to a digital pin. Syntax digitalWrite(pin, value) Parameters pin: the pin number value: HIGH or LOW Return Nothing
  • 18. Arduino Classes – Digital I/O - digitalRead() Description Reads the value from a specified digital pin, either HIGH or LOW. Syntax digitalRead(pin) Parameters pin: the number of the digital pin you want to read Return HIGH or LOW
  • 19. Time
  • 20. Arduino Classes – Time - delay() Description Pauses the program for the amount of time (in milliseconds) specified as parameter. (There are 1000 milliseconds in a second.) Syntax delay(ms) Parameters ms: the number of milliseconds to pause (unsigned long) Return Nothing
  • 21. Arduino Classes – Time - delayMicroseconds() Description Pauses the program for the amount of time (in microseconds) specified as parameter. There are a thousand microseconds in a millisecond, and a million microseconds in a second. Currently, the largest value that will produce an accurate delay is 16383 Syntax delayMicroseconds(us) Parameters us: the number of microseconds to pause (unsigned int) Return Nothing
  • 22. Arduino Classes – Time - micros() Description Returns the number of microseconds since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 70 minutes. Syntax time = micros() Parameters Nothing Return Returns the number of microseconds since the Arduino board began running the current program.(unsigned long)
  • 23. Arduino Classes – Time - millis() Description Returns the number of milliseconds since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days. Syntax time = millis() Parameters Nothing Return Number of milliseconds since the program started (unsigned long) Notes and Warnings Please note that the return value for millis() is an unsigned long, logic errors may occur if a programmer tries to do arithmetic with smaller data types such as int’s. Even signed long may encounter errors as its maximum value is half that of its unsigned counterpart.
  • 25. Arduino Classes – Analog I/O - analogRead() Description Reads the value from the specified analog pin. The number of channels depends on the board used, assuming 10-bit analog to digital converter, mapping voltages between 0 and 5 volts into integer values between 0 and 1023. This yields a resolution between readings of: 5 volts / 1024 units or, .0049 volts (4.9 mV) per unit. The input range and resolution can be changed using analogReference(). It takes about 100 microseconds to read an analog input, Syntax val = analogRead(pin) Parameters pin: the number of the analog input pin to read from Return int (0 to 1023) Depends on the board Notes and Warnings If the analog input pin is not connected to anything, the value returned by analogRead() will fluctuate based on a number of factors (e.g. the values of the other analog inputs, how close your hand is to the board, etc.).
  • 26. Arduino Classes – Analog I/O - analogWrite() Description Writes an analog value (PWM wave) to a pin. Can be used to light a LED at varying brightnesses or drive a motor at various speeds Syntax analogWrite(pin, value) Parameters pin: the pin to write to. Allowed data types: int. value: the duty cycle: between 0 (always off) and 255 (always on). Allowed data types: int Return Nothing Notes and Warnings Please click on the below link icon for more info
  • 27. Arduino Classes – Analog I/O - analogWrite() Description Configures the reference voltage used for analog input (i.e. the value used as the top of the input range) Syntax analogReference(type) Parameters type: which type of reference to use (see list of options in the description). Return Nothing Notes and Warnings Please click on the below link icon for more info