contrôle leds arduino nano

Bonjour,
je suis débutant.
Pouvez vous me dire pourquoi le code ne fonctionne pas et comment le simplifier.
Merci beaucoup.

je veux deux groupes ou trois de leds qui s'allume chacun à leur tour.

#include <Adafruit_NeoPixel.h>

int LEDPIN = 6;

int NUMPIXELS = 50;

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, LEDPIN, NEO_GRB + NEO_KHZ800);

int delayval = 500
void setup() {
pixels.begin();
}

void loop() {

pixels.setPixelColor(0, pixels.Color(255,255,255));
pixels.setPixelColor(1, pixels.Color(255,255,255));
pixels.setPixelColor(2, pixels.Color(0,0,0));
pixels.setPixelColor(3, pixels.Color(0,0,0));
pixels.setPixelColor(4, pixels.Color(0,0,0));
pixels.setPixelColor(5, pixels.Color(255,255,255));
pixels.setPixelColor(6, pixels.Color(255,255,255));
pixels.setPixelColor(7, pixels.Color(0,0,0));
pixels.setPixelColor(8, pixels.Color(0,0,0));
pixels.setPixelColor(9, pixels.Color(0,0,0));
pixels.setPixelColor(10, pixels.Color(0,0,0));
pixels.setPixelColor(11, pixels.Color(0,0,0));
pixels.setPixelColor(12, pixels.Color(0,0,0));
pixels.setPixelColor(13, pixels.Color(0,0,0));
pixels.setPixelColor(14, pixels.Color(255,255,255));
pixels.setPixelColor(15, pixels.Color(255,255,255));
pixels.setPixelColor(16, pixels.Color(0,0,0));
pixels.setPixelColor(17, pixels.Color(0,0,0));
pixels.setPixelColor(18, pixels.Color(255,255,255));
pixels.setPixelColor(19, pixels.Color(255,255,255));
pixels.setPixelColor(20, pixels.Color(0,0,0));
pixels.setPixelColor(21, pixels.Color(0,0,0));
pixels.setPixelColor(22, pixels.Color(0,0,0));
pixels.setPixelColor(23, pixels.Color(255,255,255));
pixels.setPixelColor(24, pixels.Color(255,255,255));
pixels.setPixelColor(25, pixels.Color(0,0,0));
pixels.setPixelColor(26, pixels.Color(0,0,0));
pixels.setPixelColor(27, pixels.Color(255,255,255));
pixels.setPixelColor(28, pixels.Color(255,255,255));
pixels.setPixelColor(29, pixels.Color(0,0,0));
pixels.setPixelColor(30, pixels.Color(0,0,0));
pixels.setPixelColor(31, pixels.Color(255,255,255));
pixels.setPixelColor(32, pixels.Color(255,255,255));
pixels.setPixelColor(33, pixels.Color(0,0,0));
pixels.setPixelColor(34, pixels.Color(0,0,0));
pixels.setPixelColor(35, pixels.Color(0,0,0));
pixels.setPixelColor(36, pixels.Color(0,0,0));
pixels.setPixelColor(37, pixels.Color(0,0,0));
pixels.setPixelColor(38, pixels.Color(0,0,0));
pixels.setPixelColor(39, pixels.Color(0,0,0));
pixels.setPixelColor(40, pixels.Color(255,255,255));
pixels.setPixelColor(41, pixels.Color(255,255,255));
pixels.setPixelColor(42, pixels.Color(0,0,0));
pixels.setPixelColor(43, pixels.Color(255,255,255));
pixels.setPixelColor(44, pixels.Color(0,0,0));
pixels.setPixelColor(45, pixels.Color(0,0,0));
pixels.setPixelColor(46, pixels.Color(255,255,255));
pixels.setPixelColor(47, pixels.Color(0,0,0));
pixels.setPixelColor(48, pixels.Color(255,255,255));
pixels.setPixelColor(49, pixels.Color(255,255,255));
pixels.setPixelColor(50, pixels.Color(0,0,0));

pixels.show(); // This sends the updated pixel color to the hardware.

delay(delayval); // Delay for a period of time (in milliseconds).

pixels.setPixelColor(0, pixels.Color(0,0,0));
pixels.setPixelColor(1, pixels.Color(0,0,0));
pixels.setPixelColor(2, pixels.Color(0,0,0));
pixels.setPixelColor(3, pixels.Color(255,255,255));
pixels.setPixelColor(4, pixels.Color(0,0,0));
pixels.setPixelColor(5, pixels.Color(0,0,0));
pixels.setPixelColor(6, pixels.Color(0,0,0));
pixels.setPixelColor(7, pixels.Color(0,0,0));
pixels.setPixelColor(8, pixels.Color(255,255,255));
pixels.setPixelColor(9, pixels.Color(0,0,0));
pixels.setPixelColor(10, pixels.Color(0,0,0));
pixels.setPixelColor(11, pixels.Color(0,0,0));
pixels.setPixelColor(12, pixels.Color(255,255,255));
pixels.setPixelColor(13, pixels.Color(0,0,0));
pixels.setPixelColor(14, pixels.Color(0,0,0));
pixels.setPixelColor(15, pixels.Color(0,0,0));
pixels.setPixelColor(16, pixels.Color(0,0,0));
pixels.setPixelColor(17, pixels.Color(255,255,255));
pixels.setPixelColor(18, pixels.Color(0,0,0));
pixels.setPixelColor(19, pixels.Color(0,0,0));
pixels.setPixelColor(20, pixels.Color(0,0,0));
pixels.setPixelColor(21, pixels.Color(0,0,0));
pixels.setPixelColor(22, pixels.Color(0,0,0));
pixels.setPixelColor(23, pixels.Color(0,0,0));
pixels.setPixelColor(24, pixels.Color(0,0,0));
pixels.setPixelColor(25, pixels.Color(255,255,255));
pixels.setPixelColor(26, pixels.Color(0,0,0));
pixels.setPixelColor(27, pixels.Color(0,0,0));
pixels.setPixelColor(28, pixels.Color(0,0,0));
pixels.setPixelColor(29, pixels.Color(0,0,0));
pixels.setPixelColor(30, pixels.Color(255,255,255));
pixels.setPixelColor(31, pixels.Color(0,0,0));
pixels.setPixelColor(32, pixels.Color(0,0,0));
pixels.setPixelColor(33, pixels.Color(0,0,0));
pixels.setPixelColor(34, pixels.Color(255,255,255));
pixels.setPixelColor(35, pixels.Color(0,0,0));
pixels.setPixelColor(36, pixels.Color(0,0,0));
pixels.setPixelColor(37, pixels.Color(0,0,0));
pixels.setPixelColor(38, pixels.Color(255,255,255));
pixels.setPixelColor(39, pixels.Color(0,0,0));
pixels.setPixelColor(40, pixels.Color(0,0,0));
pixels.setPixelColor(41, pixels.Color(0,0,0));
pixels.setPixelColor(42, pixels.Color(255,255,255));
pixels.setPixelColor(43, pixels.Color(0,0,0));
pixels.setPixelColor(44, pixels.Color(255,255,255));
pixels.setPixelColor(45, pixels.Color(255,255,255));
pixels.setPixelColor(46, pixels.Color(0,0,0));
pixels.setPixelColor(47, pixels.Color(255,255,255));
pixels.setPixelColor(48, pixels.Color(0,0,0));
pixels.setPixelColor(49, pixels.Color(0,0,0));
pixels.setPixelColor(50, pixels.Color(0,0,0));

pixels.show(); // This sends the updated pixel color to the hardware.

delay(delayval); // Delay for a period of time (in milliseconds).

control_led_.ino (15.3 KB)

Déjà tu lis les messages épinglés et notamment (mais pas seulement) celui ci :
http://forum.arduino.cc/index.php?topic=315372.0
Tel que ton code est présenté pas grand monde aura envie de s'insquinter les yeux à le lire.
N'oublies pas d'indenter ton code (control T) avant de le copier.

Deux choses
Il manque un point virgule à la fin de cette ligne

int delayval = 500

Et tu déclares 50 leds mais tu en utilises 51 (de 0 à 50)