Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
33 views

1 Pull Up & Pull Down: W W R R W

The document discusses using Arduino to control LEDs and read sensor input. It explains how to use pins as inputs or outputs, take sensor readings from a potentiometer, map readings to PWM values, and use analogWrite to control LED brightness. It also covers printing values to the serial monitor and using delay to add timing between steps.

Uploaded by

Hadi Korani
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)
33 views

1 Pull Up & Pull Down: W W R R W

The document discusses using Arduino to control LEDs and read sensor input. It explains how to use pins as inputs or outputs, take sensor readings from a potentiometer, map readings to PWM values, and use analogWrite to control LED brightness. It also covers printing values to the serial monitor and using delay to add timing between steps.

Uploaded by

Hadi Korani
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/ 6

29/10/2018

■ int led = 13; ■ digitalWrite(ledPin, HIGH);


■ pinMode(ledPin, OUTPUT); ■ digitalWrite(ledPin, LOW);
■ pinMode(potPin, INPUT);

‫ﻣﺜﺎلﻫﺎ‬
■ digitalRead(keyPin);
■ Serial.begin(9600); ■ analogRead(potPin);
■ Serial.print("The value: "); ■ analogWrite(ledPin, 255);
■ Serial.println(value); ■ delay(1000);

■ map(sensorReading, 0, 1023, 0, 255);

1 Pull Up & Pull Down


: LED ■
29/10/2018

2
! "# LED ■

PWM

analogWrite(ledPin, 255);
29/10/2018

4 ;( <
# (' ) * LED ( PWM % & ' ■
5 delay) . ( ' &. # * / ( 0 12 500 +
360 <<=1023
( 7 9 ( 0 12 200 ( 67 # 6 8

3 5
Serial monitor . ( > ;( < ) ■ . #* LED ( ;( < ■

. ? @' A # ;( < % & ' ■


29/10/2018

5
. ; *7 ' B < " ! "# )2C LED 4 % & ' ■

. "D E " ! "# BF5 2 ■

. " "# ! BE ' ;( < ■

G' 6
LED ( G' % &' ■
29/10/2018

7 8
. 7 J> K 2. ( ' L/ % & ' ■ . 7 6 ( 2. LED 5 # ( ' L/ % & ' ■

N 7 6 ( 2. LED 5 # ( ' L/ % & ' ■


. " 7 LED ( O " PA ( 7

7segment
20 ■
14
1E 30 ■
32 50 ■
F6 246 ■
29/10/2018

7segment

You might also like