RSeries astromech firmware
PeriscopeLight.h File Reference
#include <LedControl.h>
+ Include dependency graph for PeriscopeLight.h:

Go to the source code of this file.

Macros

#define ON   1
 
#define OFF   0
 
#define TOP_RED   0
 
#define REAR   1
 
#define BOTTOM   2
 
#define LEFT   3
 
#define RIGHT   4
 
#define CENTER   5
 
#define TOP_GREEN   6
 
#define TOP_BLUE   7
 
#define RED   0
 
#define GREEN   1
 
#define BLUE   2
 
#define MAGENTA   3
 
#define CYAN   4
 
#define YELLOW   5
 
#define WHITE   6
 
#define REAR_BI_LED_TOP_PIN   0
 
#define REAR_BI_LED_BOT_PIN   1
 
#define REAR_BI_LED_BOTH   2
 
#define DIAMOND   0b10101010
 
#define BOX   0b01010101
 
#define POINTUP   0b10010100
 
#define POINTDWN   0b01001001
 
#define ALL   0b11111111
 
#define FRONT_RED   0b00100000
 
#define FRONT_GREEN   0b01000000
 
#define FRONT_BLUE   0b10000000
 
#define FRONT_YELLOW   0b01100000
 
#define FRONT_CYAN   0b11000000
 
#define FRONT_MAGENTA   0b10100000
 
#define FRONT_WHITE   0b11100000
 
#define BACK_RED   0b00000100
 
#define BACK_GREEN   0b00001000
 
#define BACK_BLUE   0b00010000
 
#define BACK_YELLOW   0b00001100
 
#define BACK_CYAN   0b00011000
 
#define BACK_MAGENTA   0b00010100
 
#define BACK_WHITE   0b00011100
 
#define BOTH_RED   0b00100100
 
#define BOTH_GREEN   0b01001000
 
#define BOTH_BLUE   0b10010000
 
#define BOTH_YELLOW   0b01101100
 
#define BOTH_CYAN   0b11011000
 
#define BOTH_MAGENTA   0b10110100
 
#define BOTH_WHITE   0b11111100
 
#define TOP_WHITE   0b00000001
 
#define BOTTOM_WHITE   0b00000010
 
#define BOTH_WHITE   0b00000011
 

Functions

void setup ()
 
void loop ()
 
void MainLEDCode ()
 
void TopLEDCode ()
 
void FastTopLEDCode ()
 
void Dagobah (int Rate)
 
void Sith (int Rate)
 
void ObiWan (int Rate)
 
void Yoda (int Rate)
 
void SearchLight ()
 
void Sparkle (byte mode)
 
void RightSideLED (byte Pattern, byte Pattern2, byte OnTime, byte OffTime)
 
void LeftSideLED (byte Pattern, byte Pattern2, byte OnTime, byte OffTime)
 
void RearSingleLED (byte Pattern, byte OnTime, byte OffTime)
 
void RearTopLED (byte Pattern, byte OnTime, byte OffTime)
 
void RearBottomLED (byte Pattern, byte OnTime, byte OffTime)
 
byte BounceTopLED (byte Color, byte Rate)
 
byte SplitBounceTopLED (byte Color, byte Rate)
 
byte RadiateTopLED (byte Color, byte Rate)
 
void FlashTopLED (byte FlashPattern, byte Color, byte OnTime, byte OffTime, byte Random)
 
void BigLED (int OnTime, int OffTime)
 
void MainRingFlash (byte FlashPattern, int OnTime, int OffTime, byte Random)
 
void MainRingSpin (byte SpinNumber, int SpinRate, byte SpinDir)
 
void BottomLEDChase (byte Time)
 
void SetTopLed (byte Device, byte Row, byte Col, byte State)
 
void SetTopRow (byte Device, byte Row, byte Value)
 
void BottomLEDFlash (byte FlashPattern, int OnTime, int OffTime, byte Random)
 
void Initialize ()
 

Variables

byte first_time = 1
 
byte BottomLEDChaseState = 0
 
byte RightLEDstate = 0
 
byte LeftLEDstate = 0
 
byte BounceTopLEDstate = 0
 
byte SplitBounceTopLEDstate = 0
 
byte RadiateTopLEDstate = 0
 
byte RearSingleLEDOnState = 0
 
byte RearTopLEDOnState = 0
 
byte RearBottomLEDOnState = 0
 
byte SequenceOneState = 0
 
byte SequenceTwoState = 0
 
byte SequenceThreeState = 0
 
byte SequenceFourState = 0
 
byte SequenceFiveState = 0
 
byte SequenceSixState = 0
 
byte SequenceSevenState = 0
 
byte SequenceEightState = 0
 
byte FlashTopLEDOnState = 0
 
byte RightSideLEDOnState = 0
 
byte LeftSideLEDOnState = 0
 
byte BottomLEDFlashState = 0
 
byte MainFlashState = 0
 
byte BigLEDOnState = 0
 
byte MainLEDCodeState = 0
 
byte BigLEDCodeState = 0
 
byte Top_Position = 6
 
byte Bottom_Position = 0
 
byte center_pos = 0
 
unsigned long time = 0
 
unsigned long last_time = 0
 
unsigned long Main_Loop_Time = 0
 
unsigned int MainTime = 0
 
int TopTime = 0
 
int BottomTime = 0
 
int RightTime = 0
 
int LeftTime = 0
 
int MainSpinTime = 0
 
int MainFlashTime = 0
 
int BigLEDFlashTime = 0
 
int TopFlashTime = 0
 
int SplitTopTime = 0
 
int RadiateTopTime = 0
 
int RightSideLEDTime = 0
 
int LeftSideLEDTime = 0
 
int RearSingleLEDFlashTime = 0
 
int RearTopLEDFlashTime = 0
 
int RearBottomLEDFlashTime = 0
 
int SequenceOneTime = 0
 
int SequenceTwoTime = 0
 
int SequenceThreeTime = 0
 
int SequenceFourTime = 0
 
int SequenceFiveTime = 0
 
int SequenceSixTime = 0
 
int SequenceSevenTime = 0
 
int SequenceEightTime = 0
 
int BottomLEDFlashTime = 0
 
byte Speed = 10
 
byte Brightness = 15
 
byte DigInState = 0
 
byte lastDigInState
 
byte Pattern = 0
 
byte TopColor = 0
 
int TopRate = 10
 
int TopRateOFF = 10
 
byte FastTopColor = 0
 
int FastTopRate = 10
 
int FastTopRateOFF = 10
 
byte MainPattern = 0
 
byte MainLEDSpinDirection = 0
 
byte MainLEDSpinNumber = 0
 
byte MainLEDFlashPattern = 0
 
int MainLEDRate = 0
 
int MainLEDOFF = 0
 
byte BigLEDCodeON = 0
 
byte BigLEDCodeOFF = 0
 
byte BigLEDCodeMode = 0
 
unsigned int BigLEDCodeTime = 0
 
unsigned int BigLEDPatternTime = 1000
 
unsigned int TopLEDCodeTime = 0
 
unsigned int PatternSelectTime = 1000
 
unsigned int FastTopLEDCodeTime = 0
 
unsigned int FastPatternSelectTime = 100
 
byte FastPattern = 0
 
unsigned int MainLEDCodeTime = 0
 
unsigned int MainLEDPatternTime = 0
 
LedControl lc =LedControl(12,11,10,1)
 

Macro Definition Documentation

◆ ALL

#define ALL   0b11111111

◆ BACK_BLUE

#define BACK_BLUE   0b00010000

◆ BACK_CYAN

#define BACK_CYAN   0b00011000

◆ BACK_GREEN

#define BACK_GREEN   0b00001000

◆ BACK_MAGENTA

#define BACK_MAGENTA   0b00010100

◆ BACK_RED

#define BACK_RED   0b00000100

◆ BACK_WHITE

#define BACK_WHITE   0b00011100

◆ BACK_YELLOW

#define BACK_YELLOW   0b00001100

◆ BLUE

#define BLUE   2

◆ BOTH_BLUE

#define BOTH_BLUE   0b10010000

◆ BOTH_CYAN

#define BOTH_CYAN   0b11011000

◆ BOTH_GREEN

#define BOTH_GREEN   0b01001000

◆ BOTH_MAGENTA

#define BOTH_MAGENTA   0b10110100

◆ BOTH_RED

#define BOTH_RED   0b00100100

◆ BOTH_WHITE [1/2]

#define BOTH_WHITE   0b11111100

◆ BOTH_WHITE [2/2]

#define BOTH_WHITE   0b00000011

◆ BOTH_YELLOW

#define BOTH_YELLOW   0b01101100

◆ BOTTOM

#define BOTTOM   2

◆ BOTTOM_WHITE

#define BOTTOM_WHITE   0b00000010

◆ BOX

#define BOX   0b01010101

◆ CENTER

#define CENTER   5

◆ CYAN

#define CYAN   4

◆ DIAMOND

#define DIAMOND   0b10101010

◆ FRONT_BLUE

#define FRONT_BLUE   0b10000000

◆ FRONT_CYAN

#define FRONT_CYAN   0b11000000

◆ FRONT_GREEN

#define FRONT_GREEN   0b01000000

◆ FRONT_MAGENTA

#define FRONT_MAGENTA   0b10100000

◆ FRONT_RED

#define FRONT_RED   0b00100000

◆ FRONT_WHITE

#define FRONT_WHITE   0b11100000

◆ FRONT_YELLOW

#define FRONT_YELLOW   0b01100000

◆ GREEN

#define GREEN   1

◆ LEFT

#define LEFT   3

◆ MAGENTA

#define MAGENTA   3

◆ OFF

#define OFF   0

◆ ON

#define ON   1

◆ POINTDWN

#define POINTDWN   0b01001001

◆ POINTUP

#define POINTUP   0b10010100

◆ REAR

#define REAR   1

◆ REAR_BI_LED_BOT_PIN

#define REAR_BI_LED_BOT_PIN   1

◆ REAR_BI_LED_BOTH

#define REAR_BI_LED_BOTH   2

◆ REAR_BI_LED_TOP_PIN

#define REAR_BI_LED_TOP_PIN   0

◆ RED

#define RED   0

◆ RIGHT

#define RIGHT   4

◆ TOP_BLUE

#define TOP_BLUE   7

◆ TOP_GREEN

#define TOP_GREEN   6

◆ TOP_RED

#define TOP_RED   0

◆ TOP_WHITE

#define TOP_WHITE   0b00000001

◆ WHITE

#define WHITE   6

◆ YELLOW

#define YELLOW   5

Function Documentation

◆ BigLED()

void BigLED ( int  OnTime,
int  OffTime 
)

◆ BottomLEDChase()

void BottomLEDChase ( byte  Time)

◆ BottomLEDFlash()

void BottomLEDFlash ( byte  FlashPattern,
int  OnTime,
int  OffTime,
byte  Random 
)

◆ BounceTopLED()

byte BounceTopLED ( byte  Color,
byte  Rate 
)

◆ Dagobah()

void Dagobah ( int  Rate)

◆ FastTopLEDCode()

void FastTopLEDCode ( )

◆ FlashTopLED()

void FlashTopLED ( byte  FlashPattern,
byte  Color,
byte  OnTime,
byte  OffTime,
byte  Random 
)

◆ Initialize()

void Initialize ( )

◆ LeftSideLED()

void LeftSideLED ( byte  Pattern,
byte  Pattern2,
byte  OnTime,
byte  OffTime 
)

◆ loop()

void loop ( )

◆ MainLEDCode()

void MainLEDCode ( )

◆ MainRingFlash()

void MainRingFlash ( byte  FlashPattern,
int  OnTime,
int  OffTime,
byte  Random 
)

◆ MainRingSpin()

void MainRingSpin ( byte  SpinNumber,
int  SpinRate,
byte  SpinDir 
)

◆ ObiWan()

void ObiWan ( int  Rate)

◆ RadiateTopLED()

byte RadiateTopLED ( byte  Color,
byte  Rate 
)

◆ RearBottomLED()

void RearBottomLED ( byte  Pattern,
byte  OnTime,
byte  OffTime 
)

◆ RearSingleLED()

void RearSingleLED ( byte  Pattern,
byte  OnTime,
byte  OffTime 
)

◆ RearTopLED()

void RearTopLED ( byte  Pattern,
byte  OnTime,
byte  OffTime 
)

◆ RightSideLED()

void RightSideLED ( byte  Pattern,
byte  Pattern2,
byte  OnTime,
byte  OffTime 
)

◆ SearchLight()

void SearchLight ( )

◆ SetTopLed()

void SetTopLed ( byte  Device,
byte  Row,
byte  Col,
byte  State 
)

◆ SetTopRow()

void SetTopRow ( byte  Device,
byte  Row,
byte  Value 
)

◆ setup()

void setup ( )

◆ Sith()

void Sith ( int  Rate)

◆ Sparkle()

void Sparkle ( byte  mode)

◆ SplitBounceTopLED()

byte SplitBounceTopLED ( byte  Color,
byte  Rate 
)

◆ TopLEDCode()

void TopLEDCode ( )

◆ Yoda()

void Yoda ( int  Rate)

Variable Documentation

◆ BigLEDCodeMode

byte BigLEDCodeMode = 0

◆ BigLEDCodeOFF

byte BigLEDCodeOFF = 0

◆ BigLEDCodeON

byte BigLEDCodeON = 0

◆ BigLEDCodeState

byte BigLEDCodeState = 0

◆ BigLEDCodeTime

unsigned int BigLEDCodeTime = 0

◆ BigLEDFlashTime

int BigLEDFlashTime = 0

◆ BigLEDOnState

byte BigLEDOnState = 0

◆ BigLEDPatternTime

unsigned int BigLEDPatternTime = 1000

◆ Bottom_Position

byte Bottom_Position = 0

◆ BottomLEDChaseState

byte BottomLEDChaseState = 0

◆ BottomLEDFlashState

byte BottomLEDFlashState = 0

◆ BottomLEDFlashTime

int BottomLEDFlashTime = 0

◆ BottomTime

int BottomTime = 0

◆ BounceTopLEDstate

byte BounceTopLEDstate = 0

◆ Brightness

byte Brightness = 15

◆ center_pos

byte center_pos = 0

◆ DigInState

byte DigInState = 0

◆ FastPattern

byte FastPattern = 0

◆ FastPatternSelectTime

unsigned int FastPatternSelectTime = 100

◆ FastTopColor

byte FastTopColor = 0

◆ FastTopLEDCodeTime

unsigned int FastTopLEDCodeTime = 0

◆ FastTopRate

int FastTopRate = 10

◆ FastTopRateOFF

int FastTopRateOFF = 10

◆ first_time

byte first_time = 1

◆ FlashTopLEDOnState

byte FlashTopLEDOnState = 0

◆ last_time

unsigned long last_time = 0

◆ lastDigInState

byte lastDigInState

◆ lc

LedControl lc =LedControl(12,11,10,1)

◆ LeftLEDstate

byte LeftLEDstate = 0

◆ LeftSideLEDOnState

byte LeftSideLEDOnState = 0

◆ LeftSideLEDTime

int LeftSideLEDTime = 0

◆ LeftTime

int LeftTime = 0

◆ Main_Loop_Time

unsigned long Main_Loop_Time = 0

◆ MainFlashState

byte MainFlashState = 0

◆ MainFlashTime

int MainFlashTime = 0

◆ MainLEDCodeState

byte MainLEDCodeState = 0

◆ MainLEDCodeTime

unsigned int MainLEDCodeTime = 0

◆ MainLEDFlashPattern

byte MainLEDFlashPattern = 0

◆ MainLEDOFF

int MainLEDOFF = 0

◆ MainLEDPatternTime

unsigned int MainLEDPatternTime = 0

◆ MainLEDRate

int MainLEDRate = 0

◆ MainLEDSpinDirection

byte MainLEDSpinDirection = 0

◆ MainLEDSpinNumber

byte MainLEDSpinNumber = 0

◆ MainPattern

byte MainPattern = 0

◆ MainSpinTime

int MainSpinTime = 0

◆ MainTime

unsigned int MainTime = 0

◆ Pattern

byte Pattern = 0

◆ PatternSelectTime

unsigned int PatternSelectTime = 1000

◆ RadiateTopLEDstate

byte RadiateTopLEDstate = 0

◆ RadiateTopTime

int RadiateTopTime = 0

◆ RearBottomLEDFlashTime

int RearBottomLEDFlashTime = 0

◆ RearBottomLEDOnState

byte RearBottomLEDOnState = 0

◆ RearSingleLEDFlashTime

int RearSingleLEDFlashTime = 0

◆ RearSingleLEDOnState

byte RearSingleLEDOnState = 0

◆ RearTopLEDFlashTime

int RearTopLEDFlashTime = 0

◆ RearTopLEDOnState

byte RearTopLEDOnState = 0

◆ RightLEDstate

byte RightLEDstate = 0

◆ RightSideLEDOnState

byte RightSideLEDOnState = 0

◆ RightSideLEDTime

int RightSideLEDTime = 0

◆ RightTime

int RightTime = 0

◆ SequenceEightState

byte SequenceEightState = 0

◆ SequenceEightTime

int SequenceEightTime = 0

◆ SequenceFiveState

byte SequenceFiveState = 0

◆ SequenceFiveTime

int SequenceFiveTime = 0

◆ SequenceFourState

byte SequenceFourState = 0

◆ SequenceFourTime

int SequenceFourTime = 0

◆ SequenceOneState

byte SequenceOneState = 0

◆ SequenceOneTime

int SequenceOneTime = 0

◆ SequenceSevenState

byte SequenceSevenState = 0

◆ SequenceSevenTime

int SequenceSevenTime = 0

◆ SequenceSixState

byte SequenceSixState = 0

◆ SequenceSixTime

int SequenceSixTime = 0

◆ SequenceThreeState

byte SequenceThreeState = 0

◆ SequenceThreeTime

int SequenceThreeTime = 0

◆ SequenceTwoState

byte SequenceTwoState = 0

◆ SequenceTwoTime

int SequenceTwoTime = 0

◆ Speed

byte Speed = 10

◆ SplitBounceTopLEDstate

byte SplitBounceTopLEDstate = 0

◆ SplitTopTime

int SplitTopTime = 0

◆ time

unsigned long time = 0

◆ Top_Position

byte Top_Position = 6

◆ TopColor

byte TopColor = 0

◆ TopFlashTime

int TopFlashTime = 0

◆ TopLEDCodeTime

unsigned int TopLEDCodeTime = 0

◆ TopRate

int TopRate = 10

◆ TopRateOFF

int TopRateOFF = 10

◆ TopTime

int TopTime = 0