Arduino 编程(1):Hello LED

Arduino 开发是一个看起来比较“高大上”的事情,这次就按部就班了。

首先 tinkerkit 和 arduino 合体,拿了个 LED 通过线缆连到 O0(一开始还搞错了连到 I0 上):

Okay 搜一下教程,好像 debian 里面安装了 arduino 就会把集成开发环境弄好,剩下似乎就是把自己加入 dialout 组。于是找了个 hello LED 的程序在 IDE 里面写了写:

const int led = 13;

void setup() {
  pinMode(led, OUTPUT);
}

void loop() {
  digitalWrite(led, HIGH);
  delay(1000);
  digitalWrite(led, LOW);
  delay(1000);
}

试着 verify 一下,似乎 okay,然后 upload 说 arduino 在 COM1 不可获得,咱没 COM 啊,后来发现原来要到 Tools->Port 选择一下,然后上传成功了。结果没反应啊。哦 13 是端口 13,我接的 O0 对应是啥,赶紧看了看连线,原来 O0 对应 11,嗯,重新上传,这不,灯亮了~

easy 啊!

——————
And Jobab died, and Husham of the land of Temani reigned in his stead

Advertisements
Arduino 编程(1):Hello LED

一个有关“Arduino 编程(1):Hello LED”的想法

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s