Yesterday made the control led, played the first, the rest of the feeling is very simple, here record
Just a couple of photos.
Play the honey module only to find the law, generally this module, there will be three pins, VCC (3.3V or 5V power supply output PIN), GNC (for Gpio pin of GNC), out/(I/O) (corresponding to the gpio number of pins), if it is necessary to send information to the Raspberry Pi, This module identifies the out, such as the sound sensor used here and the human infrared sensor, both of which need to send to the Raspberry Pi detection information, if you do not need to send a message to the Raspberry Pi, then identify the I/O, such as I this beep module, which I found with these three sensors, may not be correct
An illustration of a gpio pin that was looked up from the Internet:
Coated on the left side of the bread plate is a module, is the Raspberry Pi Independent power supply module, figuring out how to pick up when the power supply port has a problem, USB is the power supply mouth, mom eggs, general chargers are from the USB port output to micro port, I am powered by the mobile power, from the mobile power of the USB is micro-port, Can not connect, need a male-to-male USB cable, there is no way to buy a data cable alone, the module is connected to the same way as other modules, connect the power of the USB port, the above pin has 3.3V, 5V, GND, it is clear, said above, the general module requires VCC and GND, Gpio above these two quantities are limited, you can receive this independent power supply module, out pin normal to the Raspberry Pi Gpio pin, but also to prevent direct burn out Raspberry Pi, and increase the interface, easy to use!
1 #Coding=utf82 ImportRpi.gpio as GPIO3 Import Time4 5 Gpio.setmode (GPIO). BCM)6 gpio.setwarnings (False)7Gpio.setup (GPIO). Out)#LED8Gpio.setup (17,gpio. Out)#Buzzer Module9 #Gpio.setup (5, GPIO. In,pull_up_down=gpio. PUD_UP) #声音传感器TenGpio.setup (23,gpio. IN)#Infrared Sensor One A whileTrue: - #if Gpio.input (5) = = 0: #声音 - ifGpio.input (23) = =True: the Print('comming ....') -Gpio.output (18, True) -Gpio.output (17, GPIO. High) -Time.sleep (1) +Gpio.output (18, False) -Gpio.output (17, GPIO. Low) +Time.sleep (1)
Here LED is the use of the PIN number 18, beep 17, Sound 5, infrared 23, is to do the function is to detect someone on the bright LED lights and buzzer, with no voice control, so I gave comments, if you want to voice, the infrared code comments, open the sound that two lines of code can be
Today's the day. 4-digit co-yin digital tube and ultrasonic ranging
Raspberry Pi led+ buzzer + sound sensor + IR module combination to create Voice/IR control LEDs