Arduino lab 2-control led flashes

Source: Internet
Author: User

I. Tutorial Purpose
Learn how to use Arduino ide. For details, refer
Http://www.arduino.cn/thread-1065-1-1.html learning Programming Control LED blinking Arduino related syntax Basics

Ii. Experimental Equipment

Device Name Quantity
Arduino Control Panel (UNO R3) 1 block
USB data cable 1 Root
Bread 1 block
LED Light Emitting Diode 1
220 ohm resistance 1
Bread board jumper 2

III,

Iv. entity Graph

V. ControlProgram

// The LED is connected to the 8th pins of the Arduino Development Board with int ledpin = 8; // only the first execution is performed, and only one void setup () {pinmode (ledpin, output) is executed ); // set the digital I/O port mode. output is output} // This method will be executed repeatedly void loop () {digitalwrite (ledpin, high ); // set the voltage value of the 13-pin. The height is about 5 V. That is, the LED lights up delay (3000); // sets the delay time to 3000 milliseconds, in milliseconds digitalwrite (ledpin, low); // 13-pin voltage value, low = 0 V, that is, the led goes out and delay (3000); // wait 3 seconds}

Vi. Related PrinciplesFunction body: setup (), loop () use functions: pinmode, digitalwrite, and delay. For more information, see the official documentation: Traditional Chinese Syntax documentation.
Official syntax document

7. Other DIY experiments 1.
Add a button switch based on this experiment. For details, refer to lab2 to use the push button to control the LEDs.

8. ReferencesArduino ide use, use program control led http://www.arduino.cn/thread-1065-1-1.html official entry video second lesson http://v.youku.com/v_show/id_XNDU1MTI0Nzgw.html first bread led experimental http://www.geek-workshop.com/thread-993-1-1.html 2. Arduino Development Board Experiment 1: Digital Input Output http://www.geek-workshop.com/thread-840-1-1.html /? P = 315 Arduino Development Board Experiment 1: Supplement http://www.diy-robots.com /? P = 334

Lab2 uses the "press the button" control led to add a button switch more than the current experiment.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.