Author Topic: Servo/ESC/Digital output sequences: Yes, the DS can do it automagically!  (Read 4383 times)

RC Navy

  • Jr. Member
  • **
  • Posts: 54
  • When you like, even too much, it is not enough!

after some troubles (solved now: see:,841.msg2777.html#msg2777), I can present you an amazing little library to run "complex" sequences with the Digispark: <RcSeq>.
<RcSeq> is a library which relies on the <TinyPinChange>, <SoftRcPulseIn> and <SoftRcPulseOut> libraries already presented here:,689.0.html

<RcSeq> is designed to run predefined sequences (yes, you can define several sequences) which use servos/ESC and short actions (for ex: toggling a digital output). The short sequence duration shall be < 20 ms to not disturb the servo motions. The servo motions can reach several seconds.
The servos motion (intial angle, final angle, duration of the motion, percentage of motion which must be performed at half speed, initial start and duration) and short actions are described in a sequence table in flash memory. Several servos can turn simultaneously (nested commands).

A little diagram to explain what can do <RcSeq>:

- BP# stands for Push Button#,
- Emetteur stands for Transmitter,
- Récepteur stands for Receiver,
- Voie stands for Channel,
- Manche stands for Stick,
- Action courte stands for Short Action
- Clavier stands for Keyboard (Push Buttons)
- Inverse stands for toggles

The sequence(s) can be trigged with:
- a RC signal (predefined pulse width): stick position on the RC Transmitter or by using several push buttons in place of the pot of the stick
- a function called if a message is received from a <softserial> port.

The <RcSeq> library is provided with several examples:
- OnePropTo5: converts one proportionnal channel into 5 digital channels (in english specially for most of you) ;)
- RcSeqDemo: covers almost all the capabilities, sequence and short action trigger from a RC pulse (Predefined Stick position and push buttons) to put a pneumatic Zodiac from the deck of a boat to the sea whilst driving a LED (sorry, in french) :-[
- RcSeqZodiac:  sequence and short action trigger from a RC pulse (Predefined Stick position) or a message from a serial port to put a pneumatic Zodiac from the deck of a boat to the sea whilst driving a LED (sorry, in french) :-[
- UneVoieVers8: (almost the same as OnePropTo5) converts  one proportionnal channel into 8 digital channels  (sorry, in french) :-[

Now some videos to illustrate the capabilities
(credit: Alain, my hobbyist friend
RcSeqZodiac sketch: and
UneVoieVers8 sketch (extended version of OnePropTo5):

Please, note this library can not work if you are using <DigiUSB> in your sketch: this library is too time critical and must monopolize the "pin change interrupt" vector, but alternatively, you can use <SoftSerial> which is a modified version of <SoftwareSerial> because it can work with <TinyPinChange> library which allow sharing the "pin change" interruptions.

Sorry for this very long presentation, but this library is very powerful and it's not easy to detail all its capabilities...
All the details on: (in french) :-[

Find attached all the required libraries with examples.

What do you think about commanding a skull for alloween with this lib?

Last thing, new.h and new.cpp files shall be present in the Digispark core directory, otherwise, these sketches won't compile.
If you will use the next release of the arduino IDE for Digispark, those missing files will be already included.


RC Navy
« Last Edit: March 10, 2013, 05:00:51 am by RC Navy »