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.