NanoLux (Device)
3.0
Codebase for the open-source AudioLux device.
Loading...
Searching...
No Matches
nanolux_types.h
Go to the documentation of this file.
1
8
#ifndef NANOLUX_TYPES_H
9
#define NANOLUX_TYPES_H
10
11
// Pattern list function pointers
12
typedef
void (*SimplePatternList[])();
13
14
// Array size macro
15
#define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))
16
17
// ADC2 (pins A0, A1) is not available when the WiFi radio is active,
18
// so we use ADC1 (pins A2, A3). Additionally, rev 1.2 of the board
19
// must be blue-wired to use pins A2, A3.
20
// Rev 1.2: https://github.com/OPEnSLab-OSU/Nanolux/commit/caa2e2b44d8ce75352e0c0d2d5ace363cbcfa450
21
//
22
// When using a board with a version below 1.2, or an unmodified
23
// v1.2 board, set this pin to A0.
24
#define ANALOG_PIN A3
25
26
// Vowel recognition
27
enum
VowelSounds {
28
aVowel = 1,
29
eVowel = 2,
30
iVowel = 3,
31
oVowel = 4,
32
uVowel = 5,
33
noVowel = 6
34
};
35
36
// Rotary Encoder Constants
37
#define ROTARY_ENCODER_A_PIN 23
38
#define ROTARY_ENCODER_B_PIN 22
39
#define ROTARY_ENCODER_BUTTON_PIN 33
40
#define ROTARY_ENCODER_VCC_PIN -1
41
#define ROTARY_ENCODER_STEPS 4
42
43
// FastLED
44
#define MAX_LEDS 200
45
#define DATA_PIN 15
// No hardware SPI pins defined for the ESP32 yet.
46
#define CLK_PIN 14
// Use bitbanged output.
47
#define LED_TYPE SK9822
// Define LED protocol.
48
#define COLOR_ORDER BGR
// Define color color order.
49
#define MAX_BRIGHTNESS 255
50
#define FRAMES_PER_SECOND 120
51
52
// arduinoFFT
53
#define SAMPLES 128
// Must be a power of 2 // 128 - 1024
54
#define SAMPLING_FREQUENCY 10000
// Hz, must be less than 10000 due to ADC
55
#define NOISE_GATE_THRESH 20
56
#define MAX_NOISE_GATE_THRESH 100
57
58
// Mode Constants
59
#define STRIP_SPLITTING 0
60
#define Z_LAYERING 1
61
62
// Button Input
63
#define BUTTON_PIN 33
64
65
// MAX - MIN | Freq Volume
66
#define MAX_FREQUENCY 4000.0
67
#define MIN_FREQUENCY 50.0
68
#define MAX_VOLUME 3000.0
69
#define MIN_VOLUME 100.0
70
71
// The time the button must be pressed to reset the ESP32 is 10 seconds.
72
#define RESET_TIME 10000
73
74
/*******************
75
* PATTERN CONSTANTS
76
*******************/
77
78
/******************************************************************
79
* COOLING: How much does the air cool as it rises?
80
* Less cooling = taller flames. More cooling = shorter flames.
81
* Default 55, suggested range 20-100
82
*******************************************************************/
83
#define COOLING 100
84
85
/*****************************************************************************
86
* SPARKING: What chance (out of 255) is there that a new spark will be lit?
87
* Higher chance = more roaring fire. Lower chance = more flickery fire.
88
* Default 120, suggested range 50-200.
89
******************************************************************************/
90
#define SPARKING 72
91
92
// Used in Pix_Hue_Freq
93
#define VOL_SHOW true
94
95
#endif
main
nanolux_types.h
Generated by
1.11.0