Arduino Basic - LED

準(zhǔn)備硬件板子

Genuino 2560

注:

  • 需要自帶一根USB type-B 到type-A的轉(zhuǎn)接線


    USB line
  • Genuino 與 Arduino的區(qū)別

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 IDE Download

安裝驅(qū)動(dòng)

插上USB鏈接的板子,提示驅(qū)動(dòng)未安裝如下:

Driver not installed

更新驅(qū)動(dòng)程序軟件

瀏覽計(jì)算機(jī)以查找驅(qū)動(dòng)程序軟件

選擇Arduino IDE的解壓路徑下的drivers文件夾,并單擊下一步:

選擇IDE所在目錄的`drivers`子目錄

等待安裝完成

此時(shí),再看計(jì)算機(jī)管理,驅(qū)動(dòng)正確安裝

COMx

運(yùn)行跑馬燈

打開(kāi)arduino.exe,并打開(kāi)跑馬燈例程

Blink

打開(kāi)工具,并選擇Arduino對(duì)應(yīng)的板子型號(hào)和串口

稍微修改下兩滅燈的時(shí)間比,如下亮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文件到板子(自動(dòng)編譯)

上傳

實(shí)際效果

運(yùn)行

參考鏈接

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容