0% found this document useful (0 votes)
0 views11 pages

lecture-4 (Analog Input Output)

The document provides an overview of key Arduino functions related to analog input/output and serial communication, including analogRead(), analogWrite(), Serial.begin(), Serial.print(), and Serial.println(). It also explains Pulse Width Modulation (PWM) as a technique for controlling DC power and defines the Duty Cycle, which measures the percentage of time a signal is in its 'high' state. Additionally, it includes examples of using PWM control with a potentiometer.

Uploaded by

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

lecture-4 (Analog Input Output)

The document provides an overview of key Arduino functions related to analog input/output and serial communication, including analogRead(), analogWrite(), Serial.begin(), Serial.print(), and Serial.println(). It also explains Pulse Width Modulation (PWM) as a technique for controlling DC power and defines the Duty Cycle, which measures the percentage of time a signal is in its 'high' state. Additionally, it includes examples of using PWM control with a potentiometer.

Uploaded by

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

Training on Arduino

FUNCTIONS
Analog I/O
analogRead()
Reads the value from the specified analog pin. Arduino
boards contain a multichannel, 10-bit analog to digital
converter.
Syntax
analogRead(pin);
Example
FUNCTIONS
Analog I/O
analogWrite()
Writes an analog value (PWM wave) to a pin. Can be used to light a LED at
varying brightness's or drive a motor at various speeds.
Syntax
analogRead(pin, value);
Example
FUNCTIONS
Comunication
Serial.begin()
Sets the data rate in bits per second (baud) for serial data transmission.
In Arduino you can use 300, 600, 1200, 2400, 4800, 9600, 14400, 19200,
28800, 38400, 57600, or 115200. However 9600 is the standard baud
rate usually used.
Syntax
Serial.begin(speed);
Example
FUNCTIONS
Comunication
Serial.print():
Prints data to the serial port as human-readable ASCII text.
Example
Serial.print(value);
Serial.print(“Hello World”);
Serial.println():
Prints data to the serial port as human-readable ASCII text
followed by a carriage return character and a newline character.
Example
Serial.print(“value:”);
Serial.println(val);
Example 1 (Analog Read)
Example 2 (Analog Read)
Pulse Width
PWM Modulation
 Pulse Width Modulation, or PWM, is
a technique for getting analog results
with digital means.

 Pulse Width Modulation (PWM) is a


commonly used technique for
generally controlling DC power to an
electrical device.
Duty
Duty Cycle
 Cycle
The Duty Cycle is a measure of the time
the modulated signal is in its “high” state.
 It is generally recorded as the percentage of
the signal period where the signal is considered
on.
 Duty Cycle is determined by:
On
On Time
Duty Cycle  Period 100% DutyOff
VH Cycle
V
(D)
L
Period
(T)
Duty Cycle
PWM Control Using Potentiometer
PWM Control with Potentiometer

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy