EasyManua.ls Logo

SunFounder 3in1 Kit - Page 95

Default Icon
351 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...
SunFounder 3in1 Kit
void setup() {
pinMode(ledPin, OUTPUT);
}
In loop(), digitalWrite() is used to provide 5V high level signal for ledpin, which will cause voltage difference
between LED pins and light LED up.
digitalWrite(ledPin, HIGH);
If the level signal is changed to LOW, the ledPin’s signal will be returned to 0 V to turn LED off.
digitalWrite(ledPin, LOW);
An interval between on and off is required to allow people to see the change, so we use a delay(1000) code to let the
controller do nothing for 1000 ms.
delay(1000);
4.1.2 1.2 Beep
The active buzzer is a typical digital output device that is as easy to use as lighting up an LED!
Two types of buzzers are included in the kit. We need to use active buzzer. Turn them around, the sealed back (not the
exposed PCB) is the one we want.
Required Components
In this project, we need the following components.
Its definitely convenient to buy a whole kit, here’s the link:
Name ITEMS IN THIS KIT LINK
3 in 1 Starter Kit 380+
You can also buy them separately from the links below.
4.1. 1. Digital Write 91

Related product manuals