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
7
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 A2
//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 27
//23
38
#define ROTARY_ENCODER_B_PIN 33
//22
39
#define ROTARY_ENCODER_BUTTON_PIN 32
//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
// FFT
53
#define SAMPLES 128
// Must be a power of 2 // 128 - 1024
54
#define SAMPLING_FREQUENCY 8000
// Hz, must be less than 10000 due to ADC
55
#define BINS SAMPLES / 2
56
#define NOISE_GATE_THRESH 20
57
#define MAX_NOISE_GATE_THRESH 100
58
59
// Mode Constants
60
#define STRIP_SPLITTING 0
61
#define Z_LAYERING 1
62
63
// Button Input
64
#define BUTTON_PIN 32
//33
65
66
// MAX - MIN | Freq Volume
67
#define MAX_FREQUENCY 4000.0
68
#define MIN_FREQUENCY 50.0
69
#define MAX_VOLUME 3000.0
70
#define MIN_VOLUME 100.0
71
72
// The time the button must be pressed to reset the ESP32 is 10 seconds.
73
#define RESET_TIME 10000
74
75
/*******************
76
* PATTERN CONSTANTS
77
*******************/
78
79
/******************************************************************
80
* COOLING: How much does the air cool as it rises?
81
* Less cooling = taller flames. More cooling = shorter flames.
82
* Default 55, suggested range 20-100
83
*******************************************************************/
84
#define COOLING 100
85
86
/*****************************************************************************
87
* SPARKING: What chance (out of 255) is there that a new spark will be lit?
88
* Higher chance = more roaring fire. Lower chance = more flickery fire.
89
* Default 120, suggested range 50-200.
90
******************************************************************************/
91
#define SPARKING 72
92
93
// Used in Pix_Hue_Freq
94
#define VOL_SHOW true
95
96
#endif
97
main
nanolux_types.h
Generated by
1.13.2