arduino 呼吸灯

  • 内容
  • 评论
  • 相关

就是不知道一直闪会不会坏掉。针脚只能用有波浪线的

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
int led = 3;
 
void setup() {
// put your setup code here, to run once:
 
}
 
void loop() {
// put your main code here, to run repeatedly:
 
for(int i = 10; i<255; i++)
{
analogWrite(led,i);
delay(5);
}
 
for(int i = 255; i>10; i--)
{
analogWrite(led,i);
delay(5);
}
}

评论

0条评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注