# sbusuart

> **# SBUSUART**

Latest version **1.0.11** (published 2021-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install sbusuart
pnpm add sbusuart
yarn add sbusuart
bun add sbusuart
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2021-04-24 |
| First published | 2021-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | xujialiang |
| Maintainers | xujialiang |
| Keywords | sbus, s.bus, sbusreceiver |

## Links

- npm: https://www.npmjs.com/package/sbusuart
- Repository: https://github.com/xujialiang/sbus
- Homepage: https://github.com/xujialiang/sbus#readme
- Issues: https://github.com/xujialiang/sbus/issues
- npm.io page: https://npm.io/package/sbusuart

## Dependencies (1)

- [serialport](https://npm.io/package/serialport.md) ^9.0.7

## Recent versions

- 1.0.11 (latest) — 2021-04-24
- 1.0.10 — 2021-04-24
- 1.0.9 — 2021-04-17
- 1.0.8 — 2021-04-17
- 1.0.7 — 2021-04-17
- 1.0.6 — 2021-04-17
- 1.0.5 — 2021-04-17
- 1.0.3 — 2021-04-17
- 1.0.2 — 2021-04-17
- 1.0.1 — 2021-04-17
- 1.0.0 — 2021-04-17

## README

**# SBUSUART**

用于接收和解析遥控器接收机的SBUS输出信号

![Kapture 2021-04-17 at 20.43.36](example.gif)

### 安装 


```shell

npm install sbusuart --save

```


### 初始化

```javascript
const SBUSUART = require('sbusuart')

var sbus = new SBUSUART();

或自定义参数:
var sbus = new SBUSUART(start_byte = '0f', end_byte = '0x', sbus_frame_len = 25, sbus_num_channels = 18, baudRate = 100000, stopBits = 2, parity = 'even', dataBits = 8);


```



### 数值归一化(将SBUS数值，映射到0~1)

```javascript
// min表示遥控器的最小值
// max表示遥控器的最大值
sbus.setupConvertParams(min, max);
```



### 开始获取数据

```javascript
// status: 信号正常为0 信号丢失为1 输出failsafe信号时为2
// channels: 原始信号
// channels_c: 归一化值，0~1之间
sbus.start('/dev/tty.usbserial-00003314B', (status, channels, channels_c)=>{
	console.debug('Decode Data:', status, channels, channels_c);
});
```

---
_Source: https://npm.io/package/sbusuart · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
