GemmaHoopDefs.h
 1  // SPDX-FileCopyrightText: 2014 HerrRausB https://github.com/HerrRausB
 2  //
 3  // SPDX-License-Identifier: LGPL-3.0-or-later
 4  //
 5  /******************************************************************************
 6   *
 7   * this file is part of the gemma hoop animator example sketch
 8   *
 9   * it is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Lesser General Public License as
11   * published by the Free Software Foundation, either version 3 of
12   * the License, or (at your option) any later version.
13   *
14   * it is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  see the
17   * GNU Lesser General Public License for more details.
18   *
19   * you should have received a copy of the GNU Lesser General Public
20   * License along with NeoPixel.  If not, see
21   * <http://www.gnu.org/licenses/>.
22   *
23   * ----------------------------------------------------------------------------
24   *
25   * these are the general definitions and declarations for the 
26   * gemma hoop animator - unless you don't like the preset animations or
27   * find a major bug, you don't need to change anything here
28   *
29   ******************************************************************************/
30  
31  #ifndef _GEMMA_HOOP_DEFS_H_
32  #define _GEMMA_HOOP_DEFS_H_
33  
34  /******************************************************************************
35   *
36   * available actions
37   *
38   ******************************************************************************/
39  
40  #define ACT_NOP               0b00000000     // all leds off, do nothing
41  #define ACT_SIMPLE_RING       0b00000001     // all leds on
42  #define ACT_CYCLING_RING_ACLK 0b00000010     // anti clockwise cycling colors 
43  #define ACT_CYCLING_RING_CLKW 0b00000100     // clockwise cycling colors 
44  #define ACT_WHEEL_ACLK        0b00001000     // anti clockwise spinning wheel 
45  #define ACT_WHEEL_CLKW        0b00010000     // clockwise spinning wheel 
46  #define ACT_SPARKLING_RING    0b00100000     // sparkling effect 
47  
48  /******************************************************************************
49   *
50   * available color generation methods
51   *
52   ******************************************************************************/
53  
54  #define COL_RANDOM            0b01000000     // colors will be generated randomly
55  #define COL_SPECTRUM          0b10000000     // colors will be set as cyclic spectral wipe
56                                               // R -> G -> B -> R -> ...
57  
58  /******************************************************************************
59   *
60   * specifiyng the action list 
61   *
62   ******************************************************************************/
63   
64  typedef struct
65  {
66    uint16_t action_duration;       // the action's overall duration in milliseconds (be careful not 
67                                    // to use values > 2^16-1 - roughly one minute :-)
68    uint8_t action_and_color_gen;   // the color generation method
69    uint16_t action_step_duration;  // the duration of each action step rsp. the delay of the main 
70                                    // loop in milliseconds - thus, controls the action speed (be 
71                                    // careful not to use values > 2^16-1 - roughly one minute :-)
72    uint8_t color_granularity;      // controls the increment of the R, G, and B portions of the 
73                                    // rsp. color. 1 means the increment is 0,1,2,3,..., 10 means 
74                                    // the increment is 0,10,20,... don't use values > 255, and note
75                                    // that even values > 127 wouldn't make much sense...
76    uint16_t color_interval;        // controls the speed of color changing independently from action
77                                    // speed (be careful not to use values > 2^16-1 - roughly one minute :-)
78  } actiondesc;
79  
80  typedef actiondesc actionlist[];  // a simple array of actions that will be continously cycled through
81                                    // by the sketch's main loop. the number of elemnts is limitted by
82                                    // the size of RAM available on the rsp. µC
83  #endif
84