keyestudio WiKi

KS5009 Keyestudio IoT Smart Home Kit for ESP32

  • Keyestudio IoT Smart Home Kit for ESP32
  • 1. Description
  • 2. Features
  • 3. Kit list
  • 4. How to install the smart home
  • 5. Arduino Tutorial
    • 5.1 Resource compression package
    • 5.2 Getting started with Arduino
    • 5.3 How to Add Libraries?
    • 5.4 Arduino Projects
      • 5.4.1 Project 1.1 LED Blink
        • 1 Description
        • 2 Working Principle
        • 3 Parameters
        • 4 Control Pin
        • 5 Test Code
        • 6.Test Result
      • 5.4.2 Project 1.2 Breathing LED
      • 5.4.3 Project 2.1 Read the Button
      • 5.4.4 Project 2.2. Table Lamp
      • 5.4.5 Project 3.1 Read the PIR Motion Sensor
      • 5.4.6 Project 3.2 PIR Motion Sensor
      • 5.4.7 Project 4.1 Play Happy Birthday
      • 5.4.8 Project 4.2 Music Box
      • 5.4.9 Project 5.1 Control the Door
      • 5.4.10 Project 5.2 Close the Window
      • 5.4.11 Project 6.1 Control SK6812
      • 5.4.12 Project 6.2 Button
      • 5.4.13 Project 7.1 Control the Fan
      • 5.4.14 Project 7.2 Switch On or Off the Fan
      • 5.4.15 Project 8.1 Display Characters
      • 5.4.16 Project 8.2 Dangerous Gas Alarm
      • 5.4.17 Project 9 Temperature and Humidity Tester
      • 5.4.18 Project 10 Open the Door
      • 5.4.19 Project 11 Morse Code Open the Door
      • 5.4.20 Project 12.1 WiFi test
      • 5.4.21 Project 12.2 WiFi Control LED and Fan
      • 5.4.22 Project 13.1: Mobile Phone APP test
      • 5.4.23 Project 13.2 IoT Smart Home
  • 6. Python Tutorial
keyestudio WiKi
  • 5. Arduino Tutorial
  • 5.4.1 Project 1.1 LED Blink
  • View page source

5.4.1 Project 1.1 LED Blink

1 Description

image-20230927115910677

We’ve installed the driver of ESP32 PLUS development board.

In the first lesson, we will conduct an experiment to make LED blink.

Let’s connect GND and VCC to power. The LED will be on when signal end S is high level, on the contrary, LED will turn off when signal end S is low level.

In addition, the different blinking frequency can be presented by adjusting the delayed time.

2 Working Principle

LED is also the light-emitting diode, which can be made into an electronic module. It will shine if we control pins to output high level, otherwise it will be off.

3 Parameters

Working voltage

DC 3~5V

Working current

<20mA

Power

0.1W

4 Control Pin

Yellow LED

12

\

5 Test Code

#define led_y 12  //Define the yellow led pin to 12

void setup() {    //The code inside the setup function runs only once
  pinMode(led_y, OUTPUT);  //Set pin to output mode
}

void loop() {     //The code inside the loop function will always run in a loop
  digitalWrite(led_y, HIGH);  //Light up the LED
  delay(200);     //Delay statement, in ms
  digitalWrite(led_y, LOW);   //Close the LED
  delay(200);
}

6.Test Result

After uploading the code , you can see white and yellow LEDs flashing together.

Previous Next

© Copyright Shenzhen keyestudio Technology Co., Ltd.

Built with Sphinx using a theme provided by Read the Docs.