433-utils 中文文档教程
433Utils
该项目是存储库 433Utils 的 TypeScript 中的一个简单移植。 这个存储库只是调用移植库的各种可执行文件。
.cpp
文件已被修改(在 /custom433Utils/
中)以将 PIN 作为参数传递(因此不会在每次修改 PIN 时都构建文件)。
Installation
npm i 433-utils
Usage
Receive
此侦听器允许您侦听接收器在指定 PIN 上接收到的数据。
let receiver = new Receiver(0); // Set PIN
receiver.setOnReceiveListener((data) => {
// handle data value
});
Send
let transmitter = new Transmitter(1); // Set PIN
transmitter.send(123, 2, 1)
.then((values) => {
// message sent
});
Note
PIN 参数对应于 WiringPi 库中的参数。 可以在此处找到映射表。
这个项目需要:
- Raspberry PI
- 433 Mhz Transmitter (TX)
- 433 Mhz Receiver (RX)
433Utils
This project is a simple portage in TypeScript of the repository 433Utils. This repository simply calls the various executables of the ported library.
The .cpp
files have been modified (in /custom433Utils/
) to pass the PIN as argument (and thus not to build the files each time the PIN is modified).
Installation
npm i 433-utils
Usage
Receive
This listener allows you to listen to data received by the receiver on the specified PIN.
let receiver = new Receiver(0); // Set PIN
receiver.setOnReceiveListener((data) => {
// handle data value
});
Send
let transmitter = new Transmitter(1); // Set PIN
transmitter.send(123, 2, 1)
.then((values) => {
// message sent
});
Note
The PIN parameters correspond to those of the WiringPi library. The mapping table can be found here.
This project needs:
- Raspberry PI
- 433 Mhz Transmitter (TX)
- 433 Mhz Receiver (RX)