编译环境: 华硕 A3 笔记本
实验板:arduino Duemilanove 改进版控制板 ATmega8(看下面的连接)。
http://blog.ednchina.com/huanan_/1983286/message.aspx
http://item.taobao.com/auction/item_detail.htm?item_num_id=9342078118
编译环境:arduino 0022
编译器截图:
[attachimg]148608[/attachimg]
int led = 2;
int In = 1;
int Out = 3;
int temp;
void setup()
{
pinMode(led,OUTPUT);
pinMode(In,INPUT);
pinMode(Out,OUTPUT);
digitalWrite(led,LOW);
digitalWrite(Out,HIGH);
}
void loop()
{
temp = digitalRead(In);
if(temp == 0)
{
digitalWrite(led,HIGH);
}
else
{
digitalWrite(led,LOW);
}
}
视频连接:
http://v.youku.com/v_show/id_XMjU4MDY3NjY0.html
效果图:
[attachimg]148609[/attachimg]
文章评论(0条评论)
登录后参与讨论