STEP 1:下載Arduino IDE
打開網(wǎng)頁輸入網(wǎng)址http://arduino.cc/en/Main/Software
Arduino IDE老版本下載鏈接:http://arduino.cc/en/Main/OldSoftwareReleases
進入到頁面后,找到下圖顯示部分。
插上USB線,打開Arduino IDE后,找到“Blink”代碼。
通常,寫完一段代碼后,我們都需要校驗一下,看看代碼有沒有錯誤。點擊“校驗”。
下圖顯示了正在校驗中。
在下載程序之前,我們還要先告訴Arduino IDE板子型號以及相應(yīng)的串口。
選擇所用的板卡Board --> Arduino UNO。
下載完畢!
/*BlinkTurns 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 seconddigitalWrite(led, LOW); // turn the LED off by making the voltage LOWdelay(1000); // wait for a second}
/*BlinkTurns 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:復(fù)制代碼"http://",這是另一種注釋方法,表示這個符號所在行之后的文字將被注釋掉。
int?led?=?13;
void setup() {// initialize the digital pin as an output.pinMode(led, OUTPUT);}
pinMode(led, OUTPUT);
void loop() {digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)delay(1000); // wait for a seconddigitalWrite(led, LOW); // turn the LED off by making the voltage LOWdelay(1000); // wait for a second}
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);delay(1000);
免責(zé)聲明:本文內(nèi)容由21ic獲得授權(quán)后發(fā)布,版權(quán)歸原作者所有,本平臺僅提供信息存儲服務(wù)。文章僅代表作者個人觀點,不代表本平臺立場,如有問題,請聯(lián)系我們,謝謝!





