In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces QT+ raspberry pie to achieve a simple player, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.
Speaking of raspberry pie, I have bought it for some time, but I haven't made any fun equipment. I happen to be learning Clover pie recently. I saw that raspberry pie has been sitting in the corner for more than a year. Why not use it to learn programming?
Let's start with a close-up of my workbench:
Just do it. After going through a lot of trouble, first prepare the necessary equipment and necessary parts. Here I will make a brief list:
First, the hardware configuration of raspberry pie:
Raspberry pie B + one + 16G memory card
A network cable (if you have a wireless network card)
One HDMI wire
A monitor (I use a 7-inch display + driver board)
If conditions permit, you can bring a keypad, in order to facilitate debugging, is not necessary.
Next is the installation of the software part.
I use the Lite version of the raspberry pie without a graphical interface, and an ISO image of it can be downloaded from the official website, so I won't post it here.
Then burn the system with a 16-gigabyte memory card, install it on a raspberry pie, connect the monitor to see if there is any output, and if so, the preparation work is done.
Log in with your pi account and install the qt development environment:
one
two
three
Sudo apt-get upgrade
Sudo apt-get update
Sudo apt-get install qtcreator
It may be a little slow, wait patiently; when the installation is finished, type: qmake on the command line to see if there is a response, if so, congratulations, you are half done!
Because our Lite version of the system does not have a graphical interface, in order to enable it to support window graphical interface display, we need to install X-server for it. About what X-server is, you can learn about it on the network. Here, it is simply understood as the necessary conditions for the operating system to display a graphical interface. The specific commands are as follows:
one
Sudo apt-get install xorg
Because the player uses mplayer's API, to install mplayer, you can also go to the Internet to learn more about Mplayer and know that it is a multimedia player. Specific commands:
one
Sudo apt-get install mplayer
Next, we connect the raspberry pie to the current local area network through the network cable or wireless network card, so that we can use the remote SSH to operate the raspberry pie. I will not repeat the specific connection methods here. There are many tutorials on the network.
At this point, we have all the conditions, but we just need to develop the software and start running. All right, how exactly do we develop it? Then it is necessary to build a platform on the computer. There are many versions of QT,Qt to download first. I use the 3.0.1 version here. I think everyone will know how to install qt on the computer, so I won't repeat it.
The next is the development work, the source code is downloaded at the end of the article, after debugging on the computer, make sure there is no BUG (note that the version can sometimes lead to errors, installation must be carefully observed), with the FTP tool, I use FileZilla, transfer to the raspberry pie, it is best to create a new folder, my path is / home/pi/player.
Well, then it's time to get excited: compile the software. Change the directory to the place where you FTP entered the qt program and start executing these three commands:
one
two
three
The command qmake-project # is used to build the qt project
Qmake # qt compiler initialization project
The make # command is familiar to everyone and doesn't explain much.
This process is very slow, do not hurry, play with the phone, about 1 minute, see if there is no BUG output, then congratulations, you have succeeded! Then hurry up and see if it can run. Ls to see if there is a .o file, if you see this file that the software has been generated to test it first: enter. / player (this is the generated name, of course you can define it yourself), if a window appears on the screen, you should be excited, yes, you have successfully made a simple embedded work.
If we want him to boot, modify the rc.local script file to add the startup code, and when you restart again, you will find that the display has a player interface.
On QT+ raspberry pie how to achieve a simple player to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.