X
Home > Blog > STEM for Arduino > HOW to Make a Manual Lighting Sytem with Kidsuno
HOW to Make a Manual Lighting Sytem with Kidsuno
By r September 9th, 2024 49 views

1 Manual Lighting

In this experiment, we will apply both LED module and button module to form a lighting device.

Flow

4101

Assembly

line1

Required:

41_00

line1

Step 1

41_01

line1

Step 2

41_02

41_03

line1

Step 3

41_04

line1

Step 4

41_05

line1

Step 5

41_06

line1

Step 6

41_07

line1

Step 7

41_08

line1

Step 8

41_09

line1

Completed!

41_10

line1

Wiring Diagram

4102

Test Code

Open KidsBlock and connect to the board, click File –> Load from your computer.

3111

Choose D:\Code\1.Code_kidsuno to open 4.1Manual_lighting.sb3

4103

Click 3209 to connect to port and then 2210.

Explanation

5top

Code Blocks

Blocks

Code block

Events

begin

P

setmode

P

setout

P

readdigital

Operators

=

Control

forever

Control

ifelse

line5

Conceive:

  1. Initialization

    Set the pins of white LED module and button module, initialize the serial monitor.

    4104

line3

  1. Main Code

    Loop: Determine whether the button is pressed. If it is, the button outputs 0. If not, the button outputs 1.

    • Press the button (pin reads value 0), and LED will light up (pin outputs high to LED module).

    • Release the button (pin reads value 1), and LED will go off (pin IO23 outputs low to LED module).

    4105

5bottom

Test Result

4top

After uploading code, press the button, and LED lights up. When you release the button, LED is off.

4106

4bottom

Let's Make a WiFi Web Page Controls Smart Farm System!
Previous
Let's Make a WiFi Web Page Controls Smart Farm System!
Read More
HOW to Simulate Rainwater Detection with KidsIOT
Next
HOW to Simulate Rainwater Detection with KidsIOT
Read More
Message Us