RSeries astromech firmware
Holoprojector

Holoprojector.

The standard Holoprojector supported by Reeltwo based on FlthyHP.

The Holoprojector is a single 7x Neopixel ring (a second outer 12x Neopixel ring can be added).

FlthyHP

Parts Run Information

https://astromech.net/forums/showthread.php?33317-Flthy-s-Holoprojector-LED-Servo-System-Regulator-BC-Approved-100-(9-17)-Open&highlight=flthy

#include "ReelTwo.h"
#include "dome/HoloLights.h"
#include "ServoDispatchDirect.h"
#define HOLO_HSERVO 0x1000
#define HOLO_VSERVO 0x2000
const ServoSettings servoSettings[] PROGMEM = {
{ 5, 800, 1600, HOLO_HSERVO }, /* 0: horizontal front holo */
{ 6, 800, 1800, HOLO_VSERVO }, /* 1: vertical front holo */
{ 7, 800, 1600, HOLO_HSERVO }, /* 2: horizontal top holo */
{ 8, 800, 1325, HOLO_VSERVO }, /* 3: vertical top holo */
{ 9, 900, 1000, HOLO_VSERVO }, /* 4: vertical rear holo */
{ 10, 1300, 1600, HOLO_HSERVO }, /* 5: horizontal rear holo */
};
ServoDispatchDirect<SizeOfArray(servoSettings)> servoDispatch(servoSettings);
HoloLights frontHolo(2); // PIN 2
HoloLights rearHolo(3); // PIN 3
HoloLights topHolo(4); // PIN 4
void setup()
{
REELTWO_READY();
frontHolo.assignServos(&servoDispatch, 0, 1);
topHolo.assignServos(&servoDispatch, 2, 3);
rearHolo.assignServos(&servoDispatch, 4, 5);
SetupEvent::ready();
// Send command to front holoprojector
CommandEvent::process("HPF0026|20");
}
void loop()
{
AnimatedEvent::process();
}

Command Prefix: HP

DTEEC or DTEECS or DTEER or DTEEP

D - the HP designator

F - Front HP
R - Rear HP
T - Top HP
D - Radar Eye
O - Other HP
A - All 3 HPs
X - Front & Rear HPs
Y - Front & Top HPs
Z - Rear & Top HPs
S - Sequences (See Below)

T - the Sequence Type is either 0-Led Fuctions and 1-Servo Functions

EE - the Sequence Value including leading zero if necessary, ie sequence 3 is 03

C - (Optional), the Color integer value from list below:

Basic Color Integer Values
1 = Red
2 = Yellow
3 = Green
4 = Cyan (Aqua)
5 = Blue
6 = Magenta
7 = Orange
8 = Purple
9 = White
0 = Random

S - (Optional), Speed setting integer for the Dim Pulse LED function below (0-9)

R - (Optional), Random State for clearing LED displays

Random State Integer Values
1 = Use Default Sequences
2 = Use Random Sequences

P - (Optional), the Position integer value from list below:

Preset Position Integer Values
0 = Down
1 = Center
2 = Up
3 = Left
4 = Upper Left
5 = Lower Left
6 = Right
7 = Upper Right
8 = Lower Right

D001 - Leia Sequence, Random shades of blue to mimic Leia Hologram
D002C - Color Projector Sequence, Like Leia above but using color command value
D003CS - Dim Pulse Sequence, Color slowly pulses on and off
D004C - Cycle Sequence, using color command value
D005C - Toggles Color, Simply sets LEDs tp solid color value
D006 - Rainbow Sequence
D007C - Short Circuit, Led flashes on and off with interval slowing over time
D096 - Clears LED, Disables Auto LED Sequence & "Off Color"
D0971 - Clears LED, Enables Auto LED Sequence,Enables Default Sequences, Disables "Off Color"
D0972 - Clears LED, Enables Auto LED Sequence,Enables Random Sequences, Disables "Off Color"
D098 - Clears LED, Disables Auto LED Sequence, enables "Off Color"
D0991 - Clears LED, Enables Auto LED Sequence,Enables Default Sequences, Enables "Off Color"
D0992 - Clears LED, Enables Auto LED Sequence,Enables Random Sequences, Enables "Off Color"

D101P - Sends HP to a Preset Position
D102 - Enables RC Control on HP (Left/Right)
D103 - Enables RC Control on HP (Up/Down)
D104 - Sends HP to a Random Position
D105 - Wags HP Left/Right 5 times
D106 - Wags HP Up/Down 5 times
D198 - Disables Auto HP Twitch
D199 - Enables Auto HP Twitch

S1 - Leia Mode (Front HP in Down Position, Leia LED Sequence, all other HPs disabled)*
S2 - Play R2 Cartoon [OLED]
S3 - Play Deathstar Plans movie [OLED]
S4 - Clear all LEDs, Disable Auto HP Twitch, Disable Auto LED Sequence, Disables Off Color
S5 - Clear all LEDs, Enable Auto HP Twitch, Enable Auto LED Sequence (w/ default seqs.),
Disables Off
S9 - Clear all LEDs, Enable Auto HP Twitch, Enable Auto LED Sequence (w/ random seqs.),
Disables Off Color
S7 - Clear all LEDs, Disable Auto HP Twitch, Disable Auto LED Sequence, Enables Off Color
S8 - Clear all LEDs, Enable Auto HP Twitch, Enable Auto LED Sequence (w/ default seqs.),
Enables Off Color
S9 - Clear all LEDs, Enable Auto HP Twitch, Enable Auto LED Sequence (w/ random seqs.),
Enables Off Color

Runtime values can be added to any command string by appending a pipe (|) followed by a numeric value indicating the desired time in seconds you wish the sequence to run.

e.g. A007|25 would run the Rainbow Sequence on all 3 HPs for 25 seconds then clear each one, returning to the system's last known auto twitch mode.

+ Collaboration diagram for Holoprojector: