• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomeArduinoIntroductory Kit with Clear Case for ArduinoExperiment 11 Potentimeter controlling the blinkin ...
Previous Next

Experiment 11 Potentimeter controlling the blinking frequency of LED

Posted by: Alvin Jin , February 17, 2014

[vc_row][vc_column width=”1/1″][vc_column_text]The components used in this experiment are shown below:

QQ截图20140217151412

The components are one LED (color depends on pepole),one 470 ohm resistor (if you want brighter,a 100 ohm resistor can be used),one 10k ohm potentiometer, five jumper wires,and one breadboard.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width=”1/1″][vc_tour][vc_tab title=”Schematics” tab_id=”1392621134-1-59″][vc_column_text]QQ截图20140217152111[/vc_column_text][/vc_tab][vc_tab title=”Wiring diagram” tab_id=”1392621134-2-2″][vc_column_text]QQ截图20140217152528[/vc_column_text][/vc_tab][vc_tab title=”Arduino code” tab_id=”1392621972281-2-2″][vc_column_text]Arduino code:
int ledPin = 11;
int analogPin = A0;
void setup()
{
pinMode(ledPin, OUTPUT);
}
void loop()
{
int period = (1023 – analogRead(analogPin)) / 2 + 25;
digitalWrite(ledPin, HIGH);
delay(period);
digitalWrite(ledPin, LOW);
delay(period);
}[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]

Tags: Introductory Kit with Clear Case for Arduino

Share!
Tweet

Alvin Jin

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors