#include int Power = 11; int PIN = 12; #define NUMPIXELS 1 Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); void setup() { pixels.begin(); // Initialize serial communication pinMode(Power,OUTPUT); digitalWrite(Power, HIGH); Serial.begin(9600); } void loop() { if (Serial.available() > 0) { // Read the input string from the Serial Monitor String input = Serial.readStringUntil('\n'); // Remove leading and trailing whitespaces input.trim(); // Convert the input string to lowercase for case-insensitive comparisons input.toLowerCase(); // Check the user's input and set the LED color accordingly if (input == "red") { setColor(255, 0, 0); // Set the LED color to red } else if (input == "green") { setColor(0, 255, 0); // Set the LED color to green } else if (input == "blue") { setColor(0, 0, 255); // Set the LED color to blue } else { // If the input is not recognized, turn the LED off setColor(0, 0, 0); // Turn off the LED } } } void setColor(int red, int green, int blue) { // Set the color of the RGB LED pixels.setPixelColor(0, pixels.Color(red, green, blue)); pixels.show(); // Update the LED with the new color }