其它元件怎么购买?
作者:admin 日期:2007-12-15
在哪里可以买到arduino?
作者:admin 日期:2007-12-15
什么是arduino?
作者:admin 日期:2007-12-15
Arduino开发IDE接口基于开放原始码原则,可以让您免费下载使用开发出更多令人惊艳的互动作品。
在 Arduino乐园有更详尽的说明(http://arduino.tw/?page_id=23)
Tags: 入门
abs(x)
作者:admin 日期:2007-12-15
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双语手册
int analogRead(pin)
作者:admin 日期:2007-12-15
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
不同的一个插口编号,不需要申明INPUT 或 OUTPUT
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双语手册
setup()
作者:admin 日期:2007-12-15
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双语手册










