At the behest of a fellow...thread has been moved...
Here is a sample that attempts to do a rather simple animation to a single neopixel connected to PIN1. I am confused regarding the difference of how the pinout maps to GPIO versus Arduino mapping.., but never the less, the issue seems to revolve around the timing of the data stream being sent out pin1.
The led will light up, but it is TOTALLY arbitrary and has no bearing on what the program actually states:
#include <Adafruit_NeoPixel.h>
// Which pin on the Digispark is connected to the DigiLED?
//#define PIN 4 //equiv to pin 5 on Oak - see detail above
#define PIN 5 //equiv to pin 1 on Oak - default setup for DigiLED shield - see detail above
// How many DigiLEDs are attached to the Digispark? (This is on the Oak...does this make a difference?)
#define NUMPIXELS 1
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_RGB + NEO_KHZ800);
int delayval = 500; // delay for half a second
int testValue = 0;
void setup()
{
Particle.variable("testValue", testValue);
// For Use of Oak pin 1, GPIO pin 5
pinMode ( 1, OUTPUT ); //Apparently GPIO pin 5 needs to be stated as the CONSTANT?
digitalWrite ( 1, 0 ); // See detail above
pixels.begin(); // This initializes the NeoPixel library.
pinMode ( 4, INPUT ); //the constructor and begin will set this up as an output, change it back to an input if desired
pixels.show(); // Initialize all pixels to 'off'
}
void loop()
{
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
// in Red,Green,Blue order
pixels.setPixelColor(3, pixels.Color(255, 255, 255)); //white
pixels.show(); // This sends the updated pixel color to the hardware.
delay(delayval); // Delay for a period of time (in milliseconds).
pixels.setPixelColor(3, pixels.Color(0, 255, 255)); //cyan
pixels.show();
delay(delayval);
pixels.setPixelColor(3, pixels.Color(255, 0, 255)); //violet
pixels.show();
delay(delayval);
pixels.setPixelColor(3, pixels.Color(255, 255, 0)); //yellow
pixels.show();
delay(delayval);
pixels.setPixelColor(3, pixels.Color(255, 0, 0)); //red
pixels.show();
delay(delayval);
pixels.setPixelColor(3, pixels.Color(0, 255, 0)); //green
pixels.show();
delay(delayval);
pixels.setPixelColor(3, pixels.Color(0, 0, 255)); //blue
pixels.show();
delay(delayval);
testValue = testValue + 1;
}