arduino#呼吸灯
Posted luohaonan
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了arduino#呼吸灯相关的知识,希望对你有一定的参考价值。
int ledPin = 3; // 使用引脚号 void setup() { // nothing happens in setup } void loop() { // fade in from min to max in increments of 5 points: for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 2) { // sets the value (range from 0 to 255): analogWrite(ledPin, fadeValue); // wait for 30 milliseconds to see the dimming effect delay(30); } // fade out from max to min in increments of 5 points: for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 4) { // sets the value (range from 0 to 255): analogWrite(ledPin, fadeValue); // wait for 30 milliseconds to see the dimming effect delay(30); } }
以上是关于arduino#呼吸灯的主要内容,如果未能解决你的问题,请参考以下文章