EasyManua.ls Logo

Eckstein komponente KS0530 - Page 93

Default Icon
160 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
93
*/
#define LED 3 //define the pin of LED as D10
int value;
void setup()
{
pinMode(LED, OUTPUT);// initialize digital pin LED as an output.
}
void loop () {
for (value = 0; value < 255; value = value + 1) {
analogWrite (LED, value); // LED lights gradually light up
delay (5); // delay 5MS
}
for (value = 255; value > 0; value = value - 1) {
analogWrite (LED, value); // LED gradually goes out
delay (5); // delay 5MS
}
}
(5)Test Results
Upload test code successfully, LED gradually becomes brighter then darker,
like human breath.