Skip to content

Commit

Permalink
Readme and layout MBED
Browse files Browse the repository at this point in the history
Fixed layout, documentation and made sure library compiles for all supported architectures
  • Loading branch information
bmellink committed Aug 29, 2020
1 parent c48c1fc commit e67a660
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Receivers with one iBUS pin typically send servo commands over the iBUS line, bu

To install this library use the **Clone or download > Download ZIP** button on the repository home page and then install the library in your Arduino environment using **Sketch > Include Library > Add .ZIP Library...**

This library supports AVR based Arduino boards (Arduino MEGA, UNO, Nano, Micro, etc.), ESP32 based boards (ESP32, NodeMCU, etc.) and STM32 boards (STM32F103, etc.)
This library supports AVR based Arduino boards (Arduino MEGA, UNO, Nano, Micro, etc.), ESP32 based boards (ESP32, NodeMCU, etc.), STM32 boards (STM32F103, etc.) and MBED (such as the Arduino NANO 33 BLE).

### Prerequisites

Expand Down Expand Up @@ -306,4 +306,5 @@ Example sketches:
- **Ibus_multimonitor**: monitor/debugger for receivers with a two separate iBUS pins (one for servo data and one for sensor data, such as the TGY-IA6B). Prints out servo channels to the standard serial output (PC debug window) and simulates 2 sensors with random values sent back to transmitter. Requires Arduino board with 3 or more hardware serial ports (such as MEGA 2560)
- **IBus_sensor**: simulate two telemetry sensors and send values back over the iBUS to the receiver to be shown in the display of your transmitter
- **Ibus_diy_servo_STM32**: example for (large) diy DC servo's, like windshield wiper motors. Change the P I D settings for servo response and tuning
- **Ibus2PWM_mbed**: example translate iBUS signal to servo for MBED (Arduino Nano 33 BLE)
- **Robotcar**: Example remote controlled car using the VNH3SP30 motor driver
2 changes: 1 addition & 1 deletion examples/Ibus2PWM_mbed/Ibus2PWM_mbed.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


/*
Translate iBUS signal to servo
Translate iBUS signal to servo for MBED architecture (such as Arduino Nano 33 BLE)
Supports any Arduino board where serial0 is available.
Expand Down
20 changes: 8 additions & 12 deletions src/IBusBM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*
* Created 12 March 2019 Bart Mellink
* Updated 4 April 2019 to support ESP32
* Updated 21 Jul 2020 to support MBED (David Peverley)
* updated 13 jun 2019 to support STM32 (pauluzs)
* Updated 21 Jul 2020 to support MBED (David Peverley)
*/

#include <Arduino.h>
Expand Down Expand Up @@ -47,19 +48,14 @@ void onTimer() {


#if defined(ARDUINO_ARCH_MBED)

extern "C"
{
void TIMER4_IRQHandler_v()
{
if (NRF_TIMER4->EVENTS_COMPARE[0] == 1)
{
onTimer();
NRF_TIMER4->EVENTS_COMPARE[0] = 0;
extern "C" {
void TIMER4_IRQHandler_v() {
if (NRF_TIMER4->EVENTS_COMPARE[0] == 1) {
onTimer();
NRF_TIMER4->EVENTS_COMPARE[0] = 0;
}
}
}
}

#endif


Expand Down
2 changes: 1 addition & 1 deletion src/IBusBM.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class IBusBM {
static const uint8_t SENSORMAX = 10; // Max number of sensors

uint8_t state; // state machine state for iBUS protocol
Stream * stream; // serial port
HardwareSerial *stream; // serial port
uint32_t last; // milis() of prior message
uint8_t buffer[PROTOCOL_LENGTH]; // message buffer
uint8_t ptr; // pointer in buffer
Expand Down

0 comments on commit e67a660

Please sign in to comment.