学习0基础ARDUINO电子设计实战指南第2个实验遇到问题-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 3812|回复: 4

[已解决] 学习0基础ARDUINO电子设计实战指南第2个实验遇到问题

[复制链接]
发表于 2013-12-7 14:10 | 显示全部楼层 |阅读模式
第二个实验是改变管脚控制发光二极管,我成功的改变了管脚,但是我再改回去以后发现13管脚的发光二极管和第7管脚的发光二极管居然同时闪亮,这个怎么回事呢?
这个是发光二极管插在13管脚闪亮的程序

  • /*
  •   Blink
  •   Turns on an LED on for one second, then off for one second, repeatedly.
  •   This example code is in the public domain.
  • */
  • // Pin 13 has an LED connected on most Arduino boards.
  • // give it a name:
  • int led = 13;
  • // the setup routine runs once when you press reset:
  • void setup() {
  •   // initialize the digital pin as an output.
  •   pinMode(led, OUTPUT);
  • }
  • // the loop routine runs over and over again forever:
  • void loop() {
  •   digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  •   delay(1000);               // wait for a second
  •   digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  •   delay(1000);               // wait for a second
  • }


  • 第七管脚插入发光二极管闪亮程序
  • /*
  •   Blink
  •   Turns on an LED on for one second, then off for one second, repeatedly.
  •   This example code is in the public domain.
  • */
  • // Pin 13 has an LED connected on most Arduino boards.
  • // give it a name:
  • int led = 7;
  • // the setup routine runs once when you press reset:
  • void setup() {
  •   // initialize the digital pin as an output.
  •   pinMode(led, OUTPUT);
  • }
  • // the loop routine runs over and over again forever:
  • void loop() {
  •   digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  •   delay(1000);               // wait for a second
  •   digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  •   delay(1000);               // wait for a second
  • }


发表于 2013-12-7 15:55 | 显示全部楼层
{:soso_e100:}
发表于 2013-12-7 16:01 | 显示全部楼层
不科学呀,再下载一遍试试吧
发表于 2013-12-7 19:02 | 显示全部楼层
插在接口7要串一220的电阻吧。
 楼主| 发表于 2013-12-8 19:06 | 显示全部楼层
有个330的电阻
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-12-4 03:54 , Processed in 0.100139 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表