raspberry-pi4 - Raspberry Pi 4 上 RF24 的初始设置
问题描述
我对树莓派还很陌生,但我已经涉足 arduino 有一段时间了,我正试图让它们使用 nRF24L01 通信模块相互通信。我使用了 https://nrf24.github.io/RF24/md_docs_linux_install.html上的说明
Install prerequisites if there are any (MRAA, LittleWire libraries, setup SPI device etc)
Download the install.sh file from http://tmrh20.github.io/RF24Installer/RPi/install.sh
wget http://tmrh20.github.io/RF24Installer/RPi/install.sh
Make it executable
chmod +x install.sh
Run it and choose your options
./install.sh
Run an example from one of the libraries
cd rf24libs/RF24/examples_linux
Edit the gettingstarted example, to set your pin configuration
nano gettingstarted.cpp
make
sudo ./gettingstarted
我在树莓派上启用了 SPI,在安装它时,我可以选择使用 SPIDEV,我发现我需要使用它来设置它
./configure --driver=SPIDEV;make;sudo make install
但我找不到cd
更改该配置所需的位置。
我假设这是我搞砸的步骤,因为当我
nano gettingstarted.cpp
并检查
rf24(22,0)
接着
make
sudo ./gettingstarted
我不断收到有关 SPIException 或无线电不工作的错误。
这是我的接线图……你在这张照片中看不到 nRF24L01,但所有这些引线都通向它。是的,我有一个大小合适的电容器,我的电压表显示我有一个稳定的 3.7 伏电压连接到收音机。
使用下面的引脚图,我使用了以下
MOSI -19
MISO -21
SCLK -23
CSN -24
CE -11 OR 22
**(I switched to 22 because I read that it was the default to go to)**
VCC -1
GND -6
拜托,我真的只想让这个收音机工作。有人可以逐步说明我如何才能让 RF24 在树莓派 4 上工作吗?
解决方案
推荐阅读
- css - 无法让 css 模块在 Typescript Storybook 项目中工作
- css - 如何使弹性方向行响应
- java - 无法在 IE 中使用 Xpath Selenium 找到元素
- python - 从 booster predict() 函数预测类标签
- javascript - 使用 jest 在 Promise 中测试异步函数
- python - 多边形裁剪图像python:如何更改蒙版颜色
- node.js - 将 Node.js 与 mongoDB 一起使用时,“insertMany”如何与 Mongoose 一起使用?
- rust - 是否可以编写一个对其输入进行位操作并用作匹配模式的宏?
- terraform - 强制 Terraform 使用特定区域进行数据收集
- node.js - 广播也在广播正在输入的同一个用户