use NEOPIXELRING with Arduino Uno as a timer

Hello everybody,

I’m new at programming and especially with Arduino and neopixel.

Here is my Project:
I’m triyng to Programm a simple timer with my neopixelring and my Arduino uno. So far so good, this was not a Problem.
The next Thing is, that I don’t want the light to get on, when I connect the USB with my Windows Computer.
Anf finally I want the light to get activated by an dslr camera application. The application alows to set triggers.

Somehow I do not understand how to get further.
I think I do have to put in the “if(serial.available) >0…” But I’m not sure.

How can I trigger the ligth in this case?

My code is here so far:

#include <Adafruit_NeoPixel.h>
#define PIN 0
#define NUM_LIGHTS  24

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LIGHTS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop() {
    uint32_t low = strip.Color(0, 0, 0); 
    uint32_t high = strip.Color(255, 255, 255);
  
    // Turn them off
    for( int i = 0; i<NUM_LIGHTS; i++){
        strip.setPixelColor(i, high);
        strip.show();
    }   
    delay(1000);
    
    for( int i = 0; i<NUM_LIGHTS; i++){
        strip.setPixelColor(i, low);
        strip.show();
           delay(1000);
    }   
    
  strip.show(0,0,0);

This seemed quite easy at the beginning but now Im struggeling.

jenilum:
I think I do have to put in the "if(serial.available) >0..."

That syntax is incorrect. It should be:

if (serial.available() > 0)