Switch pixie to neopixel code in mcopy_projector_tests

This commit is contained in:
mmcw-dev 2017-12-28 20:54:19 -05:00
parent 5a842f89c9
commit 674dc9591e
1 changed files with 20 additions and 10 deletions

View File

@ -1,15 +1,25 @@
//Test lighting with NeoPixels instead of Pixies to prevent eye damage.
//NeoPixel wiring, put 1000uF cap across 5V and GND and 470ohm resistor
//in series with the data connection to the Arduino pin
//
// ARDUINO NEOPIXEL
// 5VDC --|--| 1000uF 5V
// GND --|--| 1000uF GND
// PIN 3 --==-- 470ohm Din
//LIGHT HEADERS
#include "SoftwareSerial.h"
#include "Adafruit_Pixie.h"
//#include <Adafruit_NeoPixel.h>
//#include "SoftwareSerial.h"
//#include "Adafruit_Pixie.h"
#include <Adafruit_NeoPixel.h>
#define NUMPIXELS 1 // Number of Pixies in the strip
#define PIXIEPIN 6 // Pin number for SoftwareSerial output
//#define PIXELPIN 3 // Pin number for SoftwareSerial output
SoftwareSerial pixieSerial(-1, PIXIEPIN);
Adafruit_Pixie light = Adafruit_Pixie(NUMPIXELS, &pixieSerial);
//Adafruit_NeoPixel light = Adafruit_NeoPixel(1, PIXELPIN, NEO_GRB + NEO_KHZ800);
//#define PIXIEPIN 6 // Pin number for SoftwareSerial output
#define PIXELPIN 3 // Pin number for SoftwareSerial output
//SoftwareSerial pixieSerial(-1, PIXIEPIN);
//Adafruit_Pixie light = Adafruit_Pixie(NUMPIXELS, &pixieSerial);
Adafruit_NeoPixel light = Adafruit_NeoPixel(1, PIXELPIN, NEO_GRB + NEO_KHZ800);
/*
----------------------------------------------------
@ -72,8 +82,8 @@ void setup() {
Serial.flush();
Serial.setTimeout(serialDelay);
pixieSerial.begin(115200); // Pixie REQUIRES this baud rate
//light.begin(); //neopixel only
//pixieSerial.begin(115200); // Pixie REQUIRES this baud rate
light.begin(); //neopixel only
light.setPixelColor(0, 0, 0, 0);
light.show();