Arduino Basic - LED

准备硬件板子

Arduino Basic - LED_第1张图片
Genuino 2560

注:

  • 需要自带一根USB type-B 到type-A的转接线


    Arduino Basic - LED_第2张图片
    USB line
  • Genuino 与 Arduino的区别:

Genuino is Arduino.cc’s sister-brand created by Arduino co-founders Massimo Banzi, David Cuartielles, Tom Igoe, and David Mellis, the Arduino.cc team and community.This brand is used for boards and products sold outside the US.

下载软件 IDE

下载 Arduino IDE

Arduino Basic - LED_第3张图片
Arduino IDE Download

安装驱动

插上USB链接的板子,提示驱动未安装如下:

Arduino Basic - LED_第4张图片
Driver not installed

Arduino Basic - LED_第5张图片
更新驱动程序软件

Arduino Basic - LED_第6张图片
浏览计算机以查找驱动程序软件

选择Arduino IDE的解压路径下的drivers文件夹,并单击下一步:

Arduino Basic - LED_第7张图片
选择IDE所在目录的`drivers`子目录

等待安装完成

Arduino Basic - LED_第8张图片

此时,再看计算机管理,驱动正确安装

COMx

运行跑马灯

打开arduino.exe,并打开跑马灯例程

Arduino Basic - LED_第9张图片
Blink

打开工具,并选择Arduino对应的板子型号和串口

Arduino Basic - LED_第10张图片

稍微修改下两灭灯的时间比,如下亮3s,灭1s:

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the Uno and
  Leonardo, it is attached to digital pin 13. If you're unsure what
  pin the on-board LED is connected to on your Arduino model, check
  the documentation at http://www.arduino.cc

  This example code is in the public domain.

  modified 8 May 2014
  by Scott Fitzgerald
 */


// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(3000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

上传BIN文件到板子(自动编译)

Arduino Basic - LED_第11张图片
上传

实际效果

运行

参考链接

  • 在Windows系统上入门Arduino/ Genuino

你可能感兴趣的:(Arduino Basic - LED)