Keyestudio Smart Little Turtle Robot V3 Manual page 65

Table of Contents

Advertisement

www.keyestudio.com
}
void loop() // the loop function runs over and over again forever
{
digitalWrite(3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(3, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
//****************************************************************************
(5) Test Result:
Upload the program, LED connected to D3 flickers with the interval of 1s.
(6) Code Explanation
pinMode(3,OUTPUT)
OUTPUT
digitalWrite(3, HIGH)
5V) or LOW(output 0V)
(7) Extension Practice
- This function can denote that the pin is INPUT or
- When pin is OUTPUT, we can set it to HIGH(output
65

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents