#include <Adafruit_NeoPixel.h>

#define NUMPIXELS 1
#define PIN_NEOPIXEL 4
Adafruit_NeoPixel pixels(NUMPIXELS, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pixels.begin();
  pixels.setBrightness(10);
  Serial.println("Hello, ESP32!");
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(10); // this speeds up the simulation
  pixels.fill(0xFF0000);
  functionR();
  pixels.fill(0x00FF00);
  functionR();
  pixels.fill(0x0000FF);
  functionR();
  pixels.fill(0x000000);
  functionR();
}

void functionR(){
  pixels.show();
  delay(500);
}