Added option to use button joystic instead of accelerometer based joystick. Set as default now

This commit is contained in:
Phew
2025-12-20 10:32:12 +01:00
parent 15ce889b92
commit da047cd165

View File

@@ -1,30 +1,33 @@
/* /*
TWANG32 - An ESP32 port of TWANG TWANG32 - An ESP32 port of TWANG
(c) B. Dring 3/2018 (c) B. Dring 3/2018
License: Creative Commons 4.0 Attribution - Share Alike License: Creative Commons 4.0 Attribution - Share Alike
TWANG was originally created by Critters TWANG was originally created by Critters
https://github.com/Critters/TWANG https://github.com/Critters/TWANG
Basic hardware definitions Basic hardware definitions
Light Strip Notes: Light Strip Notes:
Noepixel / WS2812 Noepixel / WS2812
- Low Cost - Low Cost
- You might already have a strip. - You might already have a strip.
- No Clock Line - This means a fixed and relatively slow data rate and only shorter strips can be used - No Clock Line - This means a fixed and relatively slow data rate and only shorter strips can be used
- Poor Dynamic Range - The low end of brightness is basically not visible - Poor Dynamic Range - The low end of brightness is basically not visible
Dotstar (Highly recommended) Dotstar (Highly recommended)
- Higher Cost - Higher Cost
- Higher speed - Longer strips can be used. - Higher speed - Longer strips can be used.
- Great dynamic range, so lower levels and more colors can be used. - Great dynamic range, so lower levels and more colors can be used.
*/ */
#ifndef CONFIG_H #ifndef CONFIG_H
#define CONFIG_H #define CONFIG_H
/* Uncomment below to use the accelerometer base joystic of original implementation */
//#define USE_GYRO_JOYSTICK
#define DATA_PIN 16 #define DATA_PIN 16
#define CLOCK_PIN 17 #define CLOCK_PIN 17
@@ -40,28 +43,28 @@
// Check to make sure LED choice was done right // Check to make sure LED choice was done right
#if !defined(USE_NEOPIXEL) && !defined(USE_APA102) #if !defined(USE_NEOPIXEL) && !defined(USE_APA102)
#error "You must have USE_APA102 or USE_NEOPIXEL defined in config.h" #error "You must have USE_APA102 or USE_NEOPIXEL defined in config.h"
#endif #endif
#if defined(USE_NEOPIXEL) && defined(USE_APA102) #if defined(USE_NEOPIXEL) && defined(USE_APA102)
#error "Both USE_APA102 and USE_NEOPIXEL are defined in config.h. Only one can be used" #error "Both USE_APA102 and USE_NEOPIXEL are defined in config.h. Only one can be used"
#endif #endif
#ifdef USE_APA102 #ifdef USE_APA102
#define LED_TYPE APA102 #define LED_TYPE APA102
#define LED_COLOR_ORDER BGR // typically this will be the order, but switch it if not #define LED_COLOR_ORDER BGR // typically this will be the order, but switch it if not
#define CONVEYOR_BRIGHTNESS 8 #define CONVEYOR_BRIGHTNESS 8
#define LAVA_OFF_BRIGHTNESS 4 #define LAVA_OFF_BRIGHTNESS 4
#define MAX_LEDS VIRTUAL_LED_COUNT // these LEDS can handle the max #define MAX_LEDS VIRTUAL_LED_COUNT // these LEDS can handle the max
#define MIN_REDRAW_INTERVAL 1000.0 / 60.0 // divide by frames per second..if you tweak, adjust player speed #define MIN_REDRAW_INTERVAL 1000.0 / 60.0 // divide by frames per second..if you tweak, adjust player speed
#endif #endif
#ifdef USE_NEOPIXEL #ifdef USE_NEOPIXEL
#define LED_TYPE NEOPIXEL #define LED_TYPE NEOPIXEL
#define CONVEYOR_BRIGHTNESS 40 // low neopixel values are nearly off, Neopixels need a higher value #define CONVEYOR_BRIGHTNESS 40 // low neopixel values are nearly off, Neopixels need a higher value
#define LAVA_OFF_BRIGHTNESS 15 // low neopixel values are nearly off, Neopixels need a higher value #define LAVA_OFF_BRIGHTNESS 15 // low neopixel values are nearly off, Neopixels need a higher value
#define MAX_LEDS 288 // Neopixels cannot handle the framerate #define MAX_LEDS 288 // Neopixels cannot handle the framerate
#define MIN_REDRAW_INTERVAL 1000.0 / 60.0 // divide by frames per second..if you tweak adjust player speed #define MIN_REDRAW_INTERVAL 1000.0 / 60.0 // divide by frames per second..if you tweak adjust player speed
#endif #endif
// Comment or remove the next #define to disable the /metrics endpoint on the HTTP server. // Comment or remove the next #define to disable the /metrics endpoint on the HTTP server.