Skip to content
Arduino library for interacting with, and controlling the PWM Logger
C++
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples/PWMLoggerExample
src
LICENSE
README.md
keywords.txt
library.properties

README.md

Protean PWM Library

This library is designed to be used in conjunction with the Protean PWM Logger. The logger can decode and generate R/C servo signals, this library facilitates its use with an Arduino.

For a hookup guide, please go checkout the product page.

Installation

Open up the Arduino IDE, make sure the sketch that was opened has been saved. After that click Sketch -> Show Sketch Folder. This will bring you to your sketch's location on your computer. Sketch folder

Next, navigate back one directory. This will bring you to your sketchbook directory. It should contain a folder called libraries. Navigate into libraries then use git to clone Protean-PWM-Library into the libraries directory. Once that's done, restart the Arduino IDE. You will then be able to include the library in your sketch like so.

#include <PWM.h>

API Examples

The PWM class is contained in the namespace Protean, so defining a PWM instance could look something like this.

Protean::PWM myLogger;

Configure...

Reboot the logger board by calling reset().

myLogger.reset();

Disable or enable echo mode. Echo mode passes the PWM signals from the receiver to the servo when it's enabled. When it's disabled it the last timing written-to or decoded for that channel is generated.

myLogger.setEcho(true);    // Enable echo mode

myLogger.setEcho(false);   // Disable echo mode

Read...

Perform a simple read on channel 1.

int timing = myLogger.readTimingRaw(1);

Read 3 consecutive timings. Starting on channel 1 but ending with 3. The results are stored in the array timings, where index 0 is the first channel read.

int timings[3];
const int count = 3;
const int startChannel = 1;
myLogger.readTimingsRaw(startChannel, count, timings);

Write...

Perform a single write to channel 1. Note: You must first have disabled echo mode.

int someRawTiming = 117;
myLogger.writeTimingRaw(1, someRawTiming);

Write 3 consecutive timings. Starting on channel 1 but ending with 3. The timings written are someRawTimings, where index 0 is the first channel written.

int someRawTimings[3] = { 90, 117, 130 };
const int count = 3;
const int startChannel = 1;
myLogger.writeTimingsRaw(startChannel, count, someRawTimings);
You can’t perform that action at this time.