Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

The pinMode() function is used to configure a

specific pin to behave either as an input or an


output.
The digitalWrite() function is used to write a HIGH or a
LOW value to a digital pin. If the pin has been
configured as an OUTPUT with pinMode(), its voltage
will be set to the corresponding value: 5V (or 3.3V on
3.3V boards) for HIGH, 0V (ground) for LOW.
The delay function is used to suspend the
execution of a program for a particular time.
The digitalRead() function is used to read the logic state at a pin. It is capable to tell wether
the voltage at this pin is high (~ 5V) or low (~ 0V) or, in other words, if the pin is at logic state
1 or 0 (or HIGH/LOW).
Serial Communication

Activation the serial monitor to start


communication and determine the
speed of data transfer.

Sending and printing data on


serial monitor.

Receive data.

Checking whether data reception is


available.
This command is used to tell the controller to initiate communication, to send and receive data at a
specific speed. And one of these speeds:
Write a program that satisfies the following
conditions:

• Use LED, buzzer and button.

• The LED lights up continuously when you


press the button, At the same time, the
buzzer makes a interrupated sound.
Arduino analogRead() function is used to measure the voltage between 0 to 5 volts and converts it into a digital
value between 0 to 1023.
Write a program that satisfies the following
conditions:

• Use 2 LEDs and potentiometer.

• The LED1 lights up if potentiometer value is


less than 500.

• The LED2 lights up if potentiometer value is


more than 550.
Write a program that satisfies the following conditions:

• Use LED, pushbutton, buzzer and potentiometer.

• The buzzer makes a continuously sound if


potentiometer value is more than 600 and pressed
down pushbutton.

• The LED lights up if potentiometer value is less than


300 and pressed down pushbutton.

• Else that, the LED and the buzzer off.

You might also like