当前位置: 首页 > 工具软件 > Raspberry Pi > 使用案例 >

raspberry pi_Raspberry Pi入门指南

澹台宾白
2023-12-01

raspberry pi

by Sean Choi

通过蔡恩

Raspberry Pi的初学者介绍 (A Beginner’s Introduction to Raspberry Pi)

重要的是小事。 (It’s the little things that count.)

Many question what the term Internet of Things (IoT) means or what it actually represents. In simple terms, IoT is a term for categorizing anything that can connect to the Internet. This includes your Alexa, HomePod, Android watch, Samsung smart refrigerator and many more. Even if you realize that IoT is a term meant to describe a group of little devices that connect to the Internet that talk to each other, it is still rather unclear how these little devices actually do what they do.

许多人质疑“物联网 ”一词含义或实际含义。 简而言之, IoT是对可以连接到Internet的所有事物进行分类的术语。 这包括您的Alexa,HomePod,Android手表,三星智能冰箱等等。 即使您意识到物联网是一个术语,旨在描述一组相互连接的,互连互通的小型设备,但仍不清楚这些小型设备实际上是如何工作的。

In contrast, everyone knows generally what a Macbook or a computer does and what they are capable of doing. Interestingly, the internals of these IoT devices are very similar to the computers that we use everyday, which includes a processing unit, memory, network and/or bluetooth module and some other sensors.

相反,每个人通常都知道Macbook或计算机的功能以及他们的功能。 有趣的是,这些物联网设备的内部结构与我们每天使用的计算机非常相似,其中包括处理单元,内存,网络和/或蓝牙模块以及一些其他传感器。

What many people don’t realize is how easy it is to make your own IoT device using a small computer. In fact, you might wonder if there even exists a readily available, cheap, and powerful small computer. The good news is that it actually exists and it’s really powerful.

许多人没有意识到的是,创建自己的物联网有多么容易 使用小型计算机的设备。 实际上,您可能想知道是否存在一台随时可用,便宜且功能强大的小型计算机。 好消息是它确实存在 而且真的很 强大

Raspberry Pi就是这样。 (Raspberry Pi is EXACTLY That.)

Raspberry Pi is a small computer that fits snugly in your hand. Don’t be fooled by it’s size and just look at the hardware specs for the latest (3+) generation Raspberry Pi.

Raspberry Pi是一款小型计算机,可以紧紧地握在手中。 不要被它的大小所迷惑,只需看看最新一代(3+)Raspberry Pi的硬件​​规格即可。

  • 1.4 GHz 64-bit quad-core ARM Cortex-A53, 1GB RAM

    1.4 GHz 64位四核ARM Cortex-A53、1GB RAM

  • 2.4/5Ghz dual band 802.11ac Wireless LAN, 10/100/1000Mbps Ethernet

    2.4 / 5Ghz双频802.11ac无线局域网,10/100 / 1000Mbps以太网
  • Bluetooth 4.2

    蓝牙4.2
  • 4 USB ports, Full HDMI port, Combined 3.5mm audio jack and composite video port, 40 GPIO pins

    4个USB端口,完整的HDMI端口,组合的3.5mm音频插Kong和复合视频端口,40个GPIO引脚
  • Micro SD card slot, VideoCore IV 3D graphics core, Camera interface (CSI), Display interface (DSI),

    Micro SD卡插槽,VideoCore IV 3D图形核心,摄像头接口(CSI),显示接口(DSI),

As you can see, this little beast houses a Quad-Core CPU, fast wireless, bluetooth module and enough RAM to do most things you do on your computer. Better yet, this only costs $35, or about a reasonable dinner out (or 3 avocado toasts in SF).

如您所见,这只野兽拥有一个四核CPU,快速无线,蓝牙模块和足够的RAM,可以执行您在计算机上所做的大多数事情。 更好的是, 这只花了$ 35美元 ,或者说是一个合理的晚餐(或SF中的3个鳄梨吐司 )。

Raspberry Pis have an interesting naming convention. They are categorized by a combination of model name and generation. The model names include A, A+, B, B+, Zero and Compute Module (Compute Module is intended mainly for industrial applications, so we won’t touch on it in this article).

树莓派有一个有趣的命名约定。 它们通过模型名称和生成的组合进行分类。 型号名称包括A,A +,B,B +,零和计算模块(计算模块主要用于工业应用,因此在本文中我们将不再赘述)。

Each model is differentiated by available connectors and the size of the main board. There are various generations built so far, which are largely categorized by numbers from 1 to 3. Each generation is mainly differentiated by the chip performance. The latest and the most powerful version is called Raspberry Pi 3+ Model B+.

每种型号的区别在于可用的连接器和主板的尺寸。 到目前为止,已经构建了各种代,主要根据数字从1到3进行了分类。每个代的主要区别在于芯片性能。 最新,最强大的版本称为Raspberry Pi 3+ Model B +

As a reference, here are some images that show what parts are available in each of the models.

作为参考,以下是一些图像,显示每个模型中可用的零件。

Each model has it’s own tradeoffs. For example, Raspberry Pi Model Zero is the smallest of them all and consumes only 100 mA (0.5W) of power on average. (An average desktop houses a 200~1400W power supply). But, it only houses a single-core CPU, has lower RAM, and lacks a full HDMI port.

每个模型都有其自身的权衡。 例如,Raspberry Pi零模型是所有模型中最小的,平均功耗仅为100 mA(0.5W)。 (普通台式机的电源为200〜1400W)。 但是,它仅容纳一个单核CPU,具有较低的RAM,并且缺少完整的HDMI端口。

However, its smaller size allows it to fit into more spaces, which makes it useful for building devices that are space- and power-constrained. So, having multiple models to choose from increases your options for your project.

但是,其较小的尺寸使其可以放入更多的空间,这对于构建空间和功率受限的设备很有用。 因此,有多个模型可供选择会增加您的项目选择。

它运行什么软件? (What software does it run?)

Unfortunately, Raspberry Pi does not run Mac OS X or Windows. Instead, it runs a version of Linux called Raspbian. You can choose to install Raspbian on a micro SD card yourself with NOOBS installer, or purchase a pre-loaded micro SD card like one seen here. Once you plug in the micro SD card with Raspbian installed and turn on the Raspberry Pi, you get the following loading screen:

不幸的是,Raspberry Pi无法运行Mac OS X或Windows。 而是运行名为Raspbian的Linux版本。 您可以选择一个micro SD卡上一下菜鸟安装程序进行安装Raspbian,或购买预加载的micro SD卡就像一个看到这里 。 插入安装了Raspbian的micro SD卡并打开Raspberry Pi后,将显示以下加载屏幕:

As you can see, the desktop looks just like a regular desktop on your large PC. By default, you get a web browser, terminal, image viewer, calculator and many more features.

如您所见,桌面看起来就像大型PC上的常规桌面。 默认情况下,您将获得Web浏览器,终端,图像查看器,计算器和更多功能。

Raspbian also lets you install tons of software from it’s own open source software repository at no cost. The process of installing a software is also quite simple. You can utilize the apt-get command, a popular Linux command to install software from various repositories, to install any available software.

Raspbian还允许您免费从其自己的开源软件存储库中安装大量软件。 安装软件的过程也非常简单。 您可以使用apt-get命令(一种流行的Linux命令)从各种存储库安装软件,以安装任何可用的软件。

For example,sudo apt-get install scratch2 will install the popular scratch programming language. Browse around various repositories and StackOverflow, and you will soon realize you can do just about anything with these devices.

例如, sudo apt-get install scratch2将安装流行的草稿编程语言 。 浏览各种存储库和StackOverflow,您很快就会意识到,使用这些设备几乎可以执行任何操作。

您实际上可以做什么? (What can you ACTUALLY do with this?)

Ok, so now you have a small computer that runs a bunch of free software. What can you actually do with it? Well, here’s an easy and fun Python project that I have implemented with a group of middle school students as part of a coding class.

好的,现在您有了一台运行一堆免费软件的小型计算机。 您实际上可以做什么? 好吧,这是我与一群中学生一起实施的一个简单而有趣的Python项目,作为编码课程的一部分。

Using a Raspberry Pi compatible temperature/humidity/pressure sensor with LED screen, I taught the concept of randomness using random colors on the LED screen rather than numbers. My students loved how they could visually and physically interact with their own code. You can see the video of the project here:

我使用了与Raspberry Pi兼容的带有LED屏幕的温度/湿度/压力传感器,通过使用LED屏幕上的随机颜色而不是数字来教授随机性的概念。 我的学生喜欢如何与自己的代码进行视觉和物理交互。 您可以在此处查看该项目的视频:

Using the same device, we also built a calculator, gaming device, weather station and much more. I found them a very useful and cost efficient way to teach introductory programming to young students. I plan to cover the details of my curriculums in an article some other time.

使用相同的设备,我们还构建了计算器,游戏设备,气象站等等。 我发现它们是一种非常有用且经济高效的方法,可以向年轻的学生讲授入门编程。 我打算在另一篇文章中介绍课程的详细信息。

One of my colleagues at Stanford built a customized Raspberry Pi secured espresso machine to protect our precious coffee. The idea is somewhat similar to a Raspberry Pi secured door lock as seen here.

斯坦福大学的一位同事制造了一台定制的Raspberry Pi安全咖啡机,以保护我们的珍贵咖啡。 我们的想法是有点类似的看到了树莓派安全门锁这里

There are many, many articles on using a Raspberry Pi to build fun and useful IoT devices. Here are some list of them I found: Raspberry Pi Security Camera, Raspberry Pi Media Center, Raspberry Pi Code Club.

关于使用Raspberry Pi构建有趣且有用的IoT设备的文章很多。 以下是我找到的一些列表: Raspberry Pi安全摄像机Raspberry Pi媒体中心Raspberry Pi Code Club

结语 (Wrapping up)

I hope this article gives some basic insights on what Raspberry Pis are, how they are built and what they are used for. Also, I hope this article somewhat demystifies what IoT really means.

我希望本文能对Raspberry Pi是什么,它们的构建方式和用途有一些基本的了解。 此外,我希望本文能够揭开IoT真正含义的神秘面纱。

In essence, IoT is a movement to connect millions of little things using the Internet, and Raspberry Pi is one of the ways to power those little things. I truly believe that the future lies in IoT and I hope everyone try to participate in bringing it a step closer to us.

本质上,物联网是通过互联网连接数百万个小物件的运动,而Raspberry Pi是为这些小物件提供动力的方法之一。 我真的相信,未来就在物联网中,我希望每个人都可以参与,将其拉近我们。

It’s the little things that count, hundreds of ’em.
数以百计的是小事。
— Cliff Shaw.
—克里夫·肖。

This is my first article on Medium! Any comment for corrections, improvements and applauses is greatly appreciated!

这是我关于中的第一篇文章! 如有任何更正,改进和鼓掌的评论,我们将不胜感激!

翻译自: https://www.freecodecamp.org/news/beginners-guide-to-raspberry-pi-6e55080fdaaf/

raspberry pi

 类似资料: