

// Set up the rgb led names
//uint8_t ledR = A5; // cannot be used for PWM output!
//uint8_t ledG = 25; // cannot be used for PWM output! 
//uint8_t ledB = A4; 

//uint8_t ledRing = A4;

// NeoPixel test program showing use of the WHITE channel for RGBW
// pixels only (won't look correct on regular RGB NeoPixel strips).

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
 #include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif

#define PIN 5
#define PIN2 4

#define TOUCH_PIN T4 // Touch0 is T0 which is on GPIO 4.
// touch4, GPIO13

// How many NeoPixels are attached to the Arduino?
#define LED_COUNT  24
#define NUMPIXELS 24

// NeoPixel brightness, 0 (min) to 255 (max)
#define BRIGHTNESS 100

// Declare our NeoPixel strip object:
Adafruit_NeoPixel pixels(LED_COUNT, PIN, NEO_RGB + NEO_KHZ800);
Adafruit_NeoPixel pixels2(LED_COUNT, PIN2, NEO_RGB + NEO_KHZ800);
// Argument 1 = Number of pixels in NeoPixel strip
// Argument 2 = Arduino pin number (most are valid)
// Argument 3 = Pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
//   NEO_RGBW    Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
#define DELAYVAL 50 // Time (in milliseconds) to pause between updates


void setup() {
  Serial.begin(115200);
  pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
  pixels2.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}

void loop() {
  pixels.clear(); // Set all pixel colors to 'off'
  pixels2.clear(); // Set all pixel colors to 'off'

  // The first NeoPixel in a strand is #0, second is 1, all the way up
  // to the count of pixels minus one.
  Serial.println(touchRead(T0));
  if (touchRead(T0) < 16) {
      for(int i=0; i<NUMPIXELS; i++) {
        pixels.setPixelColor(i, pixels.Color(0, 150, 0));
        pixels.setBrightness(255);
        pixels.show();   // Send the updated pixel colors to the hardware.
      
        pixels2.setPixelColor(i, pixels.Color(0, 150, 0));
        pixels2.setBrightness(255);
        pixels2.show();   // Send the updated pixel colors to the hardware.
      }
  }

   delay(DELAYVAL); // Pause before next pass through loop

}
