Discover raspberry pi gpio library, include the articles, news, trends, analysis and practical advice about raspberry pi gpio library on alibabacloud.com
Reference: http://programmingadvent.blogspot.hk/2012/12/raspberry-pi-uart-with-pyserial.htmlRaspberry Pi UART with pyserial os:occidentalis v0.2Hardware:raspberry Pi Revision B with CobblerSetup:serial Loopback (Connect RX and TX pins on GPIO pins)Linux attempts to treat all
We have explained in detail the Raspberry Pi control ultrasonic module ranging (http://www.cnblogs.com/yuemo/p/8888342.html) and ultrasonic control buzzer module audible (http://www.cnblogs.com/ yuemo/p/8906111.html).Today we'll see how to apply all two modules and make an anti-theft device.First look at the connection of each pin (requires seven mother-to-female DuPont line):Ultrasonic module:1.VCC: Connec
compiler writes a cross-compiled compiler. For example, Makefile,
1 demo: $ (obj)2 $ (CXX)-o $ ^ $ (LDFLAGS)
The CXX must be arm-linux-gnueabihf-g ++ to compile the correct executable files on Raspberry Pi.
2. Compile a third-party library
If you want to set global CC and CXX variables, enter the following command every time you open a new Terminal:
1 $ export C
CROSS_COMPILE = arm-linux-gnueabihf-INSTALL_MOD_PATH =/mnt/ext4 modules_install
Copy the kernel and drive to the SD card
# Back up the original kernel firstCp/mnt/fat32/$ KERNEL. img/mnt/fat32/$ KERNEL-backup.imgScripts/mkknlimg arch/arm/boot/zImage mnt/fat32/$ KERNEL. imgCp arch/arm/boot/dts/*. dtb/mnt/fat32/Cp arch/arm/boot/dts/overlays/*. dtb */mnt/fat32/overlays/Cp arch/arm/boot/dts/overlays/README/mnt/fat32/overlays/
Update firmware
Tar xvf firmware-master.tar.gzCd firmware-master# Replaci
mode; (5) Photo time, set to 1 second; (6) image size, set to 640x480. The script will automatically take 78 photos, each of which will apply different special effect parameters.
To execute this script, you only need to enter the following command line:
$ python name_of_this_script.py
Below are some samples captured.
Small benefits
In addition to using the raspistill command line tool to manipulate the raspicam camera module, there are other methods to use. Picamera is a python
-dev Libtiff-dev Libjasper-dev2. Get the source code to create the OpenCV folder in the Raspberry Pi user directory mkdir OpenCVTo get OpenCV source code from sourceforge website, this article chooses 2.4.9 version. The download process may be slow, please wait patiently. wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/download Opencv-2.4.9.zipExtract the source c
Introduced
The DHT11 is a cheap accessory that includes temperature and humidity sensors, and the code is easy to use. This article describes if you use DHT11 in a Raspberry Pi, the code is python. If you have any questions, please leave a comment below.
Wiring
VCC Connection 5V or 3.3V
Data is connected to the Gpio (I'm picking up the B
Raspberry PI 3 to create a music player
1. Software Environment
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mplayer2//music playback software
sudo apt-get install Alsamixergui//volume control
2. Prepare the song
Find a song. MP3 Songs
Here is a: wget Http://blog.lxx1.com/wp-content/uploads/2016/07/shero.mp3
3, set the Raspberry
please refer to the other blog post for the circuit connection method: "Color control for RGB LEDs with Raspberry Pi--c language version"Python code:#!/usr/bin/env python#********************************************************* #File Name:rgb.py#author:jason Dai #Date: 2015/02/04#*********************************************************import Rpi.gpio as GPIOimport timecolors = [0xFF0000, 0x00FF00, 0x0000
0. PrefaceThis blog post may not have much use value. But practice for practice. There are many ways to use SQLite on Raspberry Pi, and there are many ways to install it. "1" assumes that Python is used, so you don't have to install SQLite because Python has its own sqlite."2" can be installed using Apt-get. Only the version of SQLite is slightly lower. "3" can be installed using the source code, directly
the digital tube. The correspondence depends on the order in which you send the data when you wire and write the code.
DS is a serial input pin, so-called serial is to make the data on a signal line in order to transmit one by one, like a string of candied fruit. This pin we received from the Raspberry Pi at any one of the Gpio ports (output mode). The
The simplest of a Raspberry Pi Gpio operation Getting started, here is a record of the followingFirst on the connection diagram:Horizontal slots. Figure Akzent The BigUsing the Gpio gnd and #18 pins, this is not, the red wire is 18 pins, the dark line is the GND pin, the following Python code:1 #Coding:utf-82 ImportGpi
Raspberry Pi B + timing to IoT Yeelink uploading CPU GPU temperatureHardware platform: Raspberry Pi B +Software platform:1 Installing the Requests LibraryFirst we have to solve the requests library, when we send to Yeelink POST message will use: R = Requests.post (Apiurl, He
Before the text
Because recently busy review exam, so did not pick up the Raspberry Pi car, until yesterday, finally empty time to put the code down and share with you.
BodyIn the second of the Raspberry Pi Trolley series, there are two ways to define the pin of the R
Github:https://github.com/hicrater/raspberry-dht11-temperature.gitFirst, look at the wiring
Wiring diagram
Vcc
Cathode
Pick up the Raspberry Pi 3.3v power supply (choose one on the line)
GND
Negative
Pick up the Raspberry
. "; }}if($data = file_get_contents ($file)) {;//This function supports version (PHP 4 >= 4.3.0, PHP 5)Echo"the content written to the file is: $data";} ?>5. Code parsingThe Python version number used here is 2.7.13Import Timeimport serialReference Python's 2 class library time and the serial Port debug library serial, in order to implement the program debugging can be written, before using the serial seria
linux applications. the reason is very simple. perl is fading out, ruby is not powerful, shell is not enough, php is not suitable, and java is not explained.
I remember that the Redhat 7 character interface installer was written in python, which was almost the first time I heard about python. it was very powerful, easy to use, and easy to modify and adjust.
Don't waste time and energy on things unrelated to business logic
Yesterday, my wife read the RPi. G
the wireless module will be high when the aux is initialized.Note: minicom communication or use other serial port programming library must pay attention to some details, 8N1 8 = 8 bytes, n= invalid verification bit, 1 = stop bit, these must be set the same, there are hardware flow control and software flow control all shut down (minicom has this option, If you do not set the hardware flow control is turned on by default)onxoff=false, rtscts=false, d
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.