Skip to content

Commit

Permalink
Updated to match flight software library API. Updated license to MIT.
Browse files Browse the repository at this point in the history
  • Loading branch information
flybrianfly committed Feb 15, 2021
1 parent 62f9faf commit 321e341
Show file tree
Hide file tree
Showing 15 changed files with 448 additions and 1,455 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

## v2.0.0
- Updated to match our [SBUS](https://github.com/bolderflight/sbus) library for flight software
- Updated license to MIT

## v1.0.1
- Updated license to GPLV3.

## v1.0.0
- Updated to Arduino 1.5 format and setting a baseline release here.
674 changes: 0 additions & 674 deletions LICENSE

This file was deleted.

10 changes: 10 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
The MIT License (MIT)

Copyright (c) 2021 Bolder Flight Systems Inc

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

166 changes: 68 additions & 98 deletions README.md

Large diffs are not rendered by default.

81 changes: 0 additions & 81 deletions examples/AIN_SBUS_example/AIN_SBUS_example.ino

This file was deleted.

103 changes: 56 additions & 47 deletions examples/SBUS_example/SBUS_example.ino
Original file line number Diff line number Diff line change
@@ -1,60 +1,69 @@
/*
SBUS_example.ino
Brian R Taylor
[email protected]
Copyright (c) 2016 Bolder Flight Systems
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Brian R Taylor
* [email protected]
*
* Copyright (c) 2021 Bolder Flight Systems Inc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the “Software”), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/

// This example reads an SBUS packet from an
// SBUS receiver (FrSky X8R) and then takes that
// packet and writes it back to an SBUS
// compatible servo. The SBUS out capability (i.e.
// writing a command to the servo) could be generated
// independently; however, the packet timing would need
// to be controlled by the programmer, the write function
// simply generates an SBUS packet and writes it to the
// servos. In this case the packet timing is handled by the
// SBUS receiver and waiting for a good packet read.

#include "SBUS.h"
/*
* This example reads an SBUS packet from an SBUS receiver and writes it to an
* SBUS compatible servo. The SBUS out capability (i.e. writing a command to
* the servo) could be generated independently; however, the packet timing
* would need to be controlled by the programmer, the write function simply
* generates an SBUS packet and writes it to the servos. In this case the
* packet timing is handled by the SBUS receiver and waiting for a good packet
* read.
*/

// a SBUS object, which is on hardware
// serial port 1
SBUS x8r(Serial1);
#include "sbus.h"

// channel, fail safe, and lost frames data
uint16_t channels[16];
bool failSafe;
bool lostFrame;
/* SbusRx object on Serial1 */
SbusRx sbus_rx(&Serial1);
/* SbusTx object on Serial1 */
SbusTx sbus_tx(&Serial1);

void setup() {
// begin the SBUS communication
x8r.begin();
/* Serial to display the received data */
Serial.begin(115200);
while (!Serial) {}
/* Begin the SBUS communication */
sbus_rx.Begin();
sbus_tx.Begin();
}

void loop() {

// look for a good SBUS packet from the receiver
if(x8r.read(&channels[0], &failSafe, &lostFrame)){

// write the SBUS packet to an SBUS compatible servo
x8r.write(&channels[0]);
if (sbus_rx.Read()) {
/* Display the received data */
for (int i = 0; i < sbus_rx.rx_channels().size(); i++) {
Serial.print(sbus_rx.rx_channels()[i]);
Serial.print("\t");
}
/* Display lost frames and failsafe data */
Serial.print(sbus_rx.lost_frame());
Serial.print("\t");
Serial.println(sbus_rx.failsafe());
/* Set the SBUS TX data to the received data */
sbus_tx.tx_channels(sbus_rx.rx_channels());
/* Write the data to the servos */
sbus_tx.Write();
}
}

Binary file removed extras/bit-mapping.ods
Binary file not shown.
Binary file removed extras/bit-mapping.pdf
Binary file not shown.
21 changes: 9 additions & 12 deletions keywords.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
SBUS KEYWORD1
begin KEYWORD2
read KEYWORD2
readCal KEYWORD2
write KEYWORD2
writeCal KEYWORD2
setEndPoints KEYWORD2
getEndPoints KEYWORD2
setReadCal KEYWORD2
getReadCal KEYWORD2
setWriteCal KEYWORD2
getWriteCal KEYWORD2
SbusRx KEYWORD1
SbusTx KEYWORD1
Begin KEYWORD2
Read KEYWORD2
rx_channels KEYWORD2
failsafe KEYWORD2
lost_frame KEYWORD2
Write KEYWORD2
tx_channels KEYWORD2
8 changes: 4 additions & 4 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name=Bolder Flight Systems SBUS
version=1.0.1
version=2.0.0
author=Brian Taylor <[email protected]>
maintainer=Brian Taylor <[email protected]>
sentence=Library for communicating with SBUS receivers and servos.
paragraph=This library works with Teensy 3.x and LC devices, the STM32L4, and the Maple Mini. If you have other Arduino devices or port this library, I would appreciate getting pull requests to update this to work with as many devices as possible.
paragraph=This library works with Teensy 3.x, 4.x, and LC devices, the STM32L4, and the Maple Mini. If you have other Arduino devices or port this library, I would appreciate getting pull requests to update this to work with as many devices as possible.
category=Device Control
url=https://github.com/bolderflight/SBUS
url=https://github.com/bolderflight/sbus-arduino
architectures=*
includes=SBUS.h
includes=sbus.h
Loading

0 comments on commit 321e341

Please sign in to comment.