microbit,arduino UNO,raspberry pi control led blinking
What is LED?
The LED is the abbreviation of light emitting diode. It is usually made of gallium arsenide, gallium phosphide semiconductor materials. The LED has two electrodes, a positive electrode and a negative electrode, it will light only when a forward current passes, and it can be red, blue, green or yellow light, etc. The color of light depends on the materials it was made. In general, the drive current for LED is 5-20mA. Therefore, in reality it usually needs an extra resistor for current limitation so as to protect the LED. What is resistor? The main function of the resistor is to limit current. In the circuit, the character ‘R’ represents resistor, and the unit of resistor is ohm(Ω). The band resistor is used in this experiment. A band resistor is one whose surface is coated with some particular color through which the resistance can be identified directly. The LED module we used in this lesson is SMD resistor. We soldered it directly to the pcb board. As is shown below:
N | NULL |
+ | VCC |
- | Pin |
Operating steps
1. First, we need to prepare the following experimental materials:
1 * microbit
1 * microbit
1 * led module
- Several Jumper wires
code:
makecode
muPython
Download the code to microbit.
Components
- 1 * Adeept Arduino UNO R3 Board
- 1 * LED Module
- 1 * USB Cable
- 1 * 3-Pin Wires
arduino code
Select the development board and download the code to microbit
View the results of the experiment
Components
- 1 * Raspberry Pi
- 1 * GPIO Extension Board
- 1 * 40-Pin GPIO Cable
- 1 * Breadboard
- 1 * LED Module
- 1 * 3-Pin Wires
Build the circuit
C code:
Python code:
For C language users:
Step 2: Edit and save the code with vim or nano.
(code path: /home/Adeept_Sensor_Kit_for_RPi_C_Code/01_LED/blinkingLed.c)
Step 3: Compile
$ sudo gcc blinkingLed.c -o led -lwiringPi
Step 4: Run
$ sudo ./led
For Python users:
Step 2: Edit and save the code with vim or nano.
(code path: /home/Adeept_Sensor_Kit_for_RPi_Python_Code/01_LED/blinkingLed_1.py)
Step 3: Run
$ sudo python blinkingLed_1.py
Now you can see the LED blinking.
Study links:https://www.adeept.com/learn/
Study video links:https://www.adeept.com/video/