
Arduino
文章平均质量分 57
njchenyi
这个作者很懒,什么都没留下…
展开
-
Arduino编译器查看串口数据
<br /><br /><br />最简单的例子:<br /> <br />void setup() <br />{ <br /> Serial.begin(9600); // 打开串口,设置波特率为9600 bps<br />}<br />void loop() <br />{<br /> int val;<br /> val=analogRead(5);//传感器接到模拟口5,数值根据自己的需要可变<br /> Serial.println(val,DEC);//从串口发原创 2011-03-17 16:24:00 · 4576 阅读 · 0 评论 -
PWM(脉冲宽度调制)
<br /> <br /><br />Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means. Digital control is used to create a square wave, a signal switched between on and off. This on-off pattern can simulate voltages in between ful翻译 2011-03-27 17:47:00 · 10255 阅读 · 0 评论 -
Arduino的模拟输入-analogRead()
analogRead()DescriptionReads the value from the specified analog pin. The Arduino board contains a 6 channel (8 channels on the Mini and Nano, 16 on the Mega), 10-bit analog to digital converter. This means that it will map input voltages between 0 and 5 v翻译 2011-03-27 17:49:00 · 56882 阅读 · 1 评论 -
Arduino的模拟输出-analogWrite()
analogWrite()DescriptionWrites an analog value (PWM wave) to a pin. Can be used to light a LED at varying brightnesses or drive a motor at various speeds. After a call to analogWrite(), the pin will generate a steady square wave of the specified duty cycle翻译 2011-03-27 17:49:00 · 96649 阅读 · 3 评论 -
Arduino例子--调光
FadingDemonstrates the use of the analogWrite() function in fading an LED off and on. AnalogWrite uses pulse width modulation (PWM), turning a digital pin on and off very quickly, to create a fading effect. Hardware RequiredArduino boardBreadboarda LEDa 22原创 2011-03-27 17:57:00 · 4072 阅读 · 0 评论 -
Arduino板PWM接口使用
<br /><br />analogWrite(pin, value)<br /> <br /> <br /><br /> 先按照下图连接号电路<br />这次就用Arduino和一组三色灯(红、黄、绿)来实际应用一下PWM吧,先先观察一下Arduino板子,共有六个PWM接口,他们分别是数字接口3、5、6、9、10、11 ,方便起见我们使用9、10、11这三个连续的PWM接口。在编写程序的过程中,我们会用到模拟写入analogWrite(PWM接口,模拟值函数,对于模拟写入analogWrite()函数,转载 2011-03-27 19:07:00 · 16080 阅读 · 0 评论 -
Fritzing介绍
<br />Fritzing是德国波茨坦应用科学大学(University of Applied Sciences Potsdam)交互设计实验室的研究员们开发的软件。它是个电子设计自动化软件,支持设计师,艺术家,研究人员和爱好者参加从物理原型到进一步实现其产品。还支持用户记录Arduino和其他电子为基础的原型,与他人分享,在教室里教电子,并建立一个生产型印刷电路板的布局。<br /> <br />官网地址:http://fritzing.org/原创 2011-03-28 09:45:00 · 6751 阅读 · 1 评论 -
Arduino例子--光控+PWM模拟输出
按照图片所示进行连接:代码:#define LED_GREEN 9//定义与绿灯连接的引脚#define LED_RED 10//定义与红灯连接的引脚int brightness = 0; // how bright the LED isint fadeAmount = 5; // how many points to fade the LED byvoid setup(){ pinMode(LED_GREEN,OUTPUT); pinMode(LED_RED,OUTPUT); Seria原创 2011-03-28 15:16:00 · 5985 阅读 · 4 评论