#include <FastLED.h>
#include <Button.h>
#define NUM_LEDS 9
#define LED_PIN 2
CRGB leds[NUM_LEDS];
int button = 3 ;
Button button2(3); // Connect your button between pin 3 and GND
int buttonstate = 1;
int Teller = 1 ;
void rood ()
{fill_solid(leds, NUM_LEDS, CRGB::Red);
FastLED.show();
}
void oranje ()
{fill_solid(leds, NUM_LEDS, CRGB(255, 128, 0));
FastLED.show();
}
void geelrood(){
fill_solid(leds, NUM_LEDS,CRGB(255, 221, 0));
FastLED.show();
}
void geel(){
fill_solid(leds, NUM_LEDS,CRGB::Yellow);
FastLED.show();
}
void lichtgroen(){
fill_solid(leds, NUM_LEDS, CRGB(79, 128, 0));
FastLED.show();
}
void groen(){
fill_solid(leds, NUM_LEDS, CRGB::Green);
FastLED.show();
}
void lichtblauw(){
fill_solid(leds, NUM_LEDS,CRGB(0, 217, 255));
FastLED.show();
}
void blauw(){
fill_solid(leds, NUM_LEDS,CRGB::Blue);
FastLED.show();
}
void wit(){
fill_solid(leds, NUM_LEDS,CRGB::White);
FastLED.show();
}
void setup() {
//Serial.begin(9600);
// pinMode(button, INPUT_PULLUP);
button2.begin();
//Serial.println("Start");
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(250);
}
void loop() {
if (button2.released())
{
Teller++;
}if ( Teller == 1 )
{
rood();
}
if ( Teller == 2 )
{
oranje();
}
if ( Teller == 3 )
{
geelrood();
}
if ( Teller == 4 )
{
geel();
}
if ( Teller == 5 )
{
lichtgroen();
}
if ( Teller == 6 )
{
lichtgroen();
}
if ( Teller == 7 )
{
lichtgroen();
}
}