// This is an example with the old and depreciated function "neopixelWrite()".
// See here the new version: https://wokwi.com/projects/415371249801518081
//
// No pinMode, nothing in setup(),
// just call "neopixelWrite()".
//
// Note 1:
// Only one led can be used with neopixelWrite(),
// It can not be changed when the code runs.
// As soon as the function is called, that
// pin seems to be fixed.
//
// Note 2:
// See this Issue: https://github.com/wokwi/wokwi-features/issues/861
// Instead of using RGB_BUILTIN, it is better to use 38 for the
// onboard RGB led.
int ledPin = 17; // Use 17 (external) or 38 (onboard)
void setup() {}
void loop()
{
// Only one Neopixel led can be used.
neopixelWrite(ledPin, 255,0,0);
delay(400);
neopixelWrite(ledPin, 0,255,0);
delay(400);
neopixelWrite(ledPin, 0,0,255);
delay(400);
}
onboard
external