Welcome to Raspbot repository
5.9 Drive LED
1. Learning target
In this course, we will learn how to use drive LED on expansion board.
2. Principle of experimental
According to the hardware interface manual, LED1 and LED2 are directly driven by the physical pins 40 and 38 of the Raspberry Pi board.
3. Coding method
In this course, we use BOARD coding method.
We need to control the 40,38 pins of the Raspberry Pi board.
4. About code
Path: /home/pi/Yahboom_project/Raspbot/2.Hardware Control course/08.Drive LED/Drive LED.ipynb
1)Import time and GPIO library

2)Set the GPIO coding mode,set LED1 and LED2 to output mode
3) Set high level to light on LED
4) Set low level to light off LED
5. Running code
Click the button shown in the figure below to run the program on the Jupyter Lab interface
6. Experimental phenomena
When we run the program that lights up the LED light, LED1 and LED2 light up red and blue respectively.
When we run the program that lights off the LED light, the two LED lights are off.