After everything is assembled, you may find that your capacitive touch button is too sensitive, or not sensitive enough. Luckily this is easy to adjust in the code.
Plug your Circuit Playground into your computer and be sure it's selected under Tools > Port > Adafruit Circuit Playground.
Open the Serial monitor and move your hands away from the buton. You should see numbers scrolling by. This is your baseline number, so write it down.
Now touch the button. This is your active number. Write this down too.
Go find this line in the code:
#define CAP_THRESHOLD 50 //Change capacitive touch sensitivitiy here
The CAP_THRESHOLD
variable is what sets the sensitivity. Change the number to something near the median point between your baseline number and your active number. Upload the code again and test to see if it's behaving better.
Flickering Adjustment
I like a really dynamic fire, where the flames burn tall but have a lot of motion and action to them. You can adjust a couple of variables so the flames react the way you want.
Look for these variables:
#define FRAMES_PER_SECOND 35 // faster or slower burning fire #define COOLING 55 // Less cooling = taller flames. Default 55, suggested range 20-100 #define SPARKING 50 //Higher chance = more roaring fire. Default 120, suggested range 50-200 #define BRIGHTNESS 125 // set global brightness here. 0-255 #define FADE 40 //How slowly the LEDs fade to off
FRAMES_PER_SECOND
will make the fire appear to burn faster or slower.
COOLING
and SPARKING
will give you the most control over the height and flicker of the flames.
BRIGHTNESS
will set the overall brightness of your project. Be sure to test it in daylight and in darkness to find the right level for your room.
FADE
will control how quickly or slowly the LEDs will fade to darkness when you touch the button.
Page last edited March 08, 2024
Text editor powered by tinymce.