预览模式: 普通 | 列表

其它元件怎么购买?

    在淘宝上有配套的元件包出售,点击这里可以进入。
    这个原件包东西只包含基本的配件,你还需要选购一些传感器才行,在当地的电子元件市场就可以买到。成都的电子市场在城隍庙,就在梁家巷附近。感应器大都很便宜,也就几块钱。看看我买的东西吧:


光敏电阻

查看更多...

Tags: 入门

分类:arduino | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1019

在哪里可以买到arduino?


    在淘宝上搜索“arduino”可以找到很多卖家,目前有串口版和USB版,最好还是买USB版的吧,方便一些,当然,价格在200-285(不含运费)之间,另外还有无线的版本,但价格偏高。成都的朋友也可以联系我(QQ:20889444)购买。

查看更多...

Tags: 入门

分类:arduino | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 780

什么是arduino?

    Arduino是一块基于开放原始码的Simple i/o接口版,并且具有使用类似java,C语言的开发环境。让您可以快速使用Arduino语言与Flash或Processing…等软件,作出互动作品。Arduino可以使用开发完成的电子组件例如Switch或sensors或其它控制器、LED、步进马达或其它输出装置。Arduino也可以独立运作成为一个可以跟软件沟通的接口,例如说:flash processing Max/MSP VVVV 或其它互动软件…
    Arduino开发IDE接口基于开放原始码原则,可以让您免费下载使用开发出更多令人惊艳的互动作品。
    在 Arduino乐园有更详尽的说明(http://arduino.tw/?page_id=23

查看更多...

Tags: 入门

分类:arduino | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1590

abs(x)

abs(x)

Description描述

Computes the absolute value of a number.
计算数字的绝对值。

 

Parameters参数

x: the number
x:数字

 

Returns返回

x: if x is greater than or equal to 0.
x:如果x大于或等于0返回x。

 

-x: if x is less than 0.
x:如果x小于0返回-x。

Tags: arduino双语手册

分类:arduino双语手册 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 363

int analogRead(pin)

int analogRead(pin)

Description描述

Reads the value from a specified analog pin, the Arduino board makes a 10-bit analog to digital conversion. This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023.
从指定的模拟接口读取值,Arduino卡对该模拟值进行10-bit的数字转换,这个方法将输入的0-5电压值转换为 0到1023间的整数值。

 

Parameters参数

You need to specify the number of the pin you want to read. It has to be one of the analog pins of the board, thus it should be a number between 0 and 5. It could also be a variable representing one value in that range.
你需要指定用于读取的接口编号,它必须是Arduino卡中的一个,因此它必须是0-5之间的整数,它同样也可以是在有效范围内的一个变量。

 

Note注释

Analog pins unlike digital ones, do not need to be declared as INPUT nor OUTPUT
不同的一个插口编号,不需要申明INPUTOUTPUT

 

This function returns返回

An integer value in the range of 0 to 1023.
0到1023中的一个整数。

 

Example范例

int ledPin = 13;   // LED connected to digital pin 13。
//LED连接到13号数字接口。
int analogPin = 3;   // potentiometer connected to analog pin 3。
//电压器连接到3号模拟接口。
int val = 0;   // variable to store the read value。设定变量。
int threshold = 512;   // threshold
void setup()
{
pinMode(ledPin, OUTPUT);   // sets the digital pin 13 as output
//设定13号数字接口为输出模式。
}
void loop()
{
val = analogRead(analogPin);   // read the input pin
// 读取输入接口。
if (val >= threshold) {
digitalWrite(ledPin, HIGH);   // sets the LED on
//设置LED开
} else {
digitalWrite(ledPin, LOW);   // sets the LED off
//设置LED关
}
}

查看更多...

Tags: arduino双语手册

分类:arduino双语手册 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 431

setup()

setup()

The setup() function is called when your program starts. Use it to initialize your variables, pin modes, start using libraries, etc.
setup()函数在程序开始时使用,可以初始化变量、接口模式、启用库等

 

Example范例

int buttonPin = 3;
void setup()
{
beginSerial(9600);
pinMode(buttonPin, INPUT);
}
void loop()
{
// ...
}

Tags: arduino双语手册

分类:arduino双语手册 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 519