Light Sculpture
Sophomore Year Light Sculpture
 All Files Functions Pages
LightSculpture.h
Go to the documentation of this file.
1 
2 /* Light Sculpture Architecture - Written by Kyle Stewart - Updated 04302018*/
3 
4 #pragma once
5 
6 #include <Arduino.h>
7 
9 // //
10 // Fading Functions //
11 // //
13 
14 void delayUsingKnob(int duration);
15 
16 void fadeUp(const byte pin, int duration);
17 void fadeUpAll(int duration);
18 void fadeUpArray(const byte arrayName[], const byte arrayLength, int duration);
19 void fadeUpArrayInOrder(const byte arrayName[], const byte arrayLength, int duration);
20 
21 void fadeDown(const byte pin, int duration);
22 void fadeDownAll(int duration);
23 void fadeDownArray(const byte arrayName[], const byte arrayLength, int duration);
24 void fadeDownArrayInOrder(const byte arrayName[], const byte arrayLength, int duration);
25 
26 void blinkArrayInOrder(const byte arrayName[], const byte arrayLength, int duration);
27 void blinkTwoArraysInOrder(const byte array1[],const byte array2[], const byte arrayLength, int duration);
28 
29 void fadeUpTwoArraysInOrder(const byte array1[],const byte array2[], const byte arrayLength, int duration);
30 void fadeDownTwoArraysInOrder(const byte array1[],const byte array2[], const byte arrayLength, int duration);
31 
32 void crossFade(const byte downPin, const byte upPin, int duration);
33 void crossFadeArrays(const byte downArrayName[], const byte downArrayLength, const byte upArrayName[], const byte upArrayLength, int duration);
34 
36 // //
37 // Mode Selection //
38 // //
40 
41 void setupLightSculpture();
42 void updateMode();
43 void updateOffSwitch();
44 void runNightLight();
45 
46 
48 // //
49 // Helper Functions //
50 // //
52 
53 void pwm(float fractionOn);
54 void pwm(const byte pin, float fractionOn);
55 void pwm(const byte arrayName[], const byte arrayLength, float fractionOn);
56 int getOnTimeUsingFraction(float fractionOn);
57 void updateStepSize(int duration);
58 int getOnTimeUsingFraction(float fractionOn);
59 void turnOnArray(const byte arrayName[], const byte arrayLength);
60 void turnOffArray(const byte arrayName[], const byte arrayLength);
61 void turnOnAll();
62 void turnOffAll();
63 
65 // //
66 // Mode Selection //
67 // //
69 
70 void setupLightSculpture();
71 void runNightLight();
72 
74 // //
75 // Knob Functions //
76 // //
78 
79 void pwmUsingKnob();
80 void updateKnobValue();
81 void updateOffSwitch();
82 int getOnTimeUsingKnob();
83 float gammaCorrect(float ratio);
84 void updateMode();
85 
87 // //
88 // Global Variable Declarations (Nouns) //
89 // //
91 
92 enum Modes {offMode, lightShowMode, nightLightMode};
93 extern Modes mode;
94 
95 
void blinkTwoArraysInOrder(const byte array1[], const byte array2[], const byte arrayLength, int duration)
Definition: LightSculpture.cpp:383
void crossFade(const byte downPin, const byte upPin, int duration)
Definition: LightSculpture.cpp:467
void fadeDownAll(int duration)
Definition: LightSculpture.cpp:276
void turnOnAll()
Definition: LightSculpture.cpp:741
void fadeUpArrayInOrder(const byte arrayName[], const byte arrayLength, int duration)
Definition: LightSculpture.cpp:235
void turnOnArray(const byte arrayName[], const byte arrayLength)
Definition: LightSculpture.cpp:715
void pwmUsingKnob()
Definition: LightSculpture.cpp:564
void fadeDownArray(const byte arrayName[], const byte arrayLength, int duration)
Definition: LightSculpture.cpp:302
void runNightLight()
Definition: LightSculpture.cpp:93
void turnOffArray(const byte arrayName[], const byte arrayLength)
Definition: LightSculpture.cpp:731
void fadeUpArray(const byte arrayName[], const byte arrayLength, int duration)
Definition: LightSculpture.cpp:204
int getOnTimeUsingKnob()
Definition: LightSculpture.cpp:591
void fadeUp(const byte pin, int duration)
Definition: LightSculpture.cpp:154
void fadeUpAll(int duration)
Definition: LightSculpture.cpp:177
void fadeDownArrayInOrder(const byte arrayName[], const byte arrayLength, int duration)
Definition: LightSculpture.cpp:332
void turnOffAll()
Definition: LightSculpture.cpp:752
void crossFadeArrays(const byte downArrayName[], const byte downArrayLength, const byte upArrayName[], const byte upArrayLength, int duration)
Definition: LightSculpture.cpp:523
void fadeUpTwoArraysInOrder(const byte array1[], const byte array2[], const byte arrayLength, int duration)
Definition: LightSculpture.cpp:413
void fadeDown(const byte pin, int duration)
Definition: LightSculpture.cpp:254
float gammaCorrect(float ratio)
Definition: LightSculpture.cpp:613
int getOnTimeUsingFraction(float fractionOn)
Definition: LightSculpture.cpp:818
void pwm(float fractionOn)
Definition: LightSculpture.cpp:648
void updateStepSize(int duration)
Definition: LightSculpture.cpp:802
void updateMode()
Definition: LightSculpture.cpp:69
void delayUsingKnob(int duration)
Definition: LightSculpture.cpp:129
void blinkArrayInOrder(const byte arrayName[], const byte arrayLength, int duration)
Definition: LightSculpture.cpp:355
void setupLightSculpture()
Definition: LightSculpture.cpp:49
void updateOffSwitch()
Definition: LightSculpture.cpp:85
void updateKnobValue()
Definition: LightSculpture.cpp:579
void fadeDownTwoArraysInOrder(const byte array1[], const byte array2[], const byte arrayLength, int duration)
Definition: LightSculpture.cpp:442