Keyestudio Smart Little Turtle Robot V3 Manual page 70

Table of Contents

Advertisement

www.keyestudio.com
*/
int ledPin = 3; // Define the LED pin at D3
int value;
void setup () {
pinMode (ledPin, OUTPUT); // initialize ledpin as an output.
}
void loop () {
for (value = 0; value <255; value = value + 1)
{
analogWrite (ledPin, value); // LED lights gradually light up
delay (5); // delay 5MS
}
for (value = 255; value> 0; value = value-1)
{
analogWrite (ledPin, value); // LED gradually goes out
delay (5); // delay 5MS
}
}
(5) Test Result:
70

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Smart Little Turtle Robot V3 and is the answer not in the manual?

Questions and answers

Table of Contents