Reboot Pack Lights Arduino (NeoPixels + 7 segment lights) (Need help)

Heres my latest arduino sketch i used for the neopixel strip/ring lights

#include <Adafruit_NeoPixel.h>

#ifdef AVR

#include <avr/power.h>

#endif

#define PIN 6

#define NUM_PIXELS 100

// Parameter 1 = number of pixels in strip

// Parameter 2 = Arduino pin number (most are valid)

// Parameter 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)

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_PIXELS, PIN, NEO_GRBW + NEO_KHZ800);

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across

// pixel power leads, add 300 - 500 Ohm resistor on first pixel’s data input

// and minimize distance between Arduino and first pixel. Avoid connecting

// on a live circuit…if you must, connect GND first.

// NOTE

// NUMBER_COMETS x (COMET_LENGTH + COMET_SPACING) must be <= TOTAL_COMET_PIXELS

// The number of pixels in each comet

#define COMET_LENGTH 12

// The number of comets

#define NUMBER_COMETS 3

// The number of pixels between each comet

#define COMET_SPACING 8

// The total number of pixels in the strip dedicated to comets

#define TOTAL_COMET_PIXELS 60

// The direction of the comet 0 or 1

#define COMET_DIRECTION 0

// The max comet brightness

#define MAX_COMET_BRIGHTNESS 255

// The comet speed

#define SPEED 50

byte rgbyRedLevels[NUM_PIXELS];

void InitComet()

{

int iIndex=0;

byte byMasterPos=0;

byte byCometIndex=0;

memset(rgbyRedLevels,0,NUM_PIXELS);

for(byCometIndex = 0; byCometIndex < NUMBER_COMETS; byCometIndex++)

{

#if COMET_DIRECTION

byte byBrightness=0;

#else

byte byBrightness = MAX_COMET_BRIGHTNESS;

#endif

// Dim comet by length

byte byDim = MAX_COMET_BRIGHTNESS / COMET_LENGTH;

for( iIndex = 0 ;   iIndex < COMET_LENGTH ; iIndex++)

{

  rgbyRedLevels[byMasterPos++] = byBrightness;

#if COMET_DIRECTION

  byBrightness += byDim;

#else

  byBrightness -= byDim;

#endif

}

byMasterPos += COMET_SPACING;

}

}

void setup() {

// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket

#if defined (AVR_ATtiny85)

if (F_CPU == 16000000) clock_prescale_set(clock_div_1);

#endif

// End of trinket special code

Serial.begin(9600); // open the serial port at 9600 bps:

strip.begin();

strip.show(); // Initialize all pixels to ‘off’

InitComet();

}

#if COMET_DIRECTION

void ProcessCometsDir()

{

byte iIndex=0;

byte byLast=0;

byte byDestPixel=0;

byte byOld=0;

byLast= rgbyRedLevels[TOTAL_COMET_PIXELS-1]; // Preserve the contents of the last pixel

for(iIndex =TOTAL_COMET_PIXELS-1 ; iIndex > 0 ; iIndex–)

{

rgbyRedLevels[iIndex] = rgbyRedLevels[iIndex-1];

}

rgbyRedLevels[0]= byLast; // Put what was the last pixel intio the first

for(iIndex =0 ; iIndex <TOTAL_COMET_PIXELS ; iIndex++)

{

   strip.setPixelColor(iIndex,rgbyRedLevels[iIndex],0,0 );

}

strip.show();

delay(SPEED);

}

#else

void ProcessCometsDir()

{

byte iIndex=0;

byte byLast=0;

byte byDestPixel=0;

byte byOld=0;

byLast= rgbyRedLevels[0]; // Preserve the contents of the last pixel

for(iIndex =0 ; iIndex < TOTAL_COMET_PIXELS-1 ; iIndex++)

{

rgbyRedLevels[iIndex] = rgbyRedLevels[iIndex+1];

}

rgbyRedLevels[TOTAL_COMET_PIXELS-1]= byLast; // Put what was the last pixel intio the first

for(iIndex =0 ; iIndex <TOTAL_COMET_PIXELS ; iIndex++)

{

   strip.setPixelColor(iIndex,rgbyRedLevels[iIndex],0,0 );

}

strip.show();

delay(SPEED);

}

#endif

void loop()

{

ProcessCometsDir();

}

and heres my latest sketch for my displays

this starts up with a scrolling display message on the top display and then proceeds to the randomizing displays

nice looking 3d printed parts by the way hehe

#include <GhostLab42Reboot.h>

#include <Wire.h>

GhostLab42Reboot reboot;

void setup()

{

reboot.begin();

reboot.write(1, “126.2”);

reboot.write(2, “-42.9”);

// Turn down the brightness of the main displays

reboot.setDisplayBrightness(0, 60);

reboot.setDisplayBrightness(1, 100);

reboot.setDisplayBrightness(2, 60);

}

void loop()

{

// String to be scrolled across the six digit display

// Need the extra spaces to make the scrolling smooth

String displayText = " Who ya gonna call? Ghostbusters! ";

// A NOTE ABOUT SCROLLING:

// This works fine if there are not any periods/decimals, since a period/decimal

// is either considered part of the previous character or its own character if

// it is in the first position of the display (in which case there is technically

// a “space” in front of it)

// Check out ex4_scrollingtextadvanced instead if you are planning on scrolling a

// string with a period/decimal

// Commence scrolling

for (int i = 0; i < displayText.length(); i++)

{

reboot.write(0, displayText.substring(i, i + 6));

delay(250);

}

// Clear and start over

reboot.resetDisplay(0);

String countStr;

int count = 2087;

for (int i = 0; i < 1000; i++)

{

// Count down

reboot.write(0, String(120999 - i));

// Count up with leading 0s really fast

countStr = "000" + String(16 * i);

reboot.write(1, countStr.substring(countStr.length() - 4));



// Show a number that is about 2087 but moves around randomly by a few counts

// Slow the update down so it changes more slowly

if ((i % 30) == 0)

{

  count = 2087 + random(-2, 3);

}



reboot.write(2, String(count));

delay(30);

}}

@tommyb: The seven segment code is perf, thanks so much for that! The Idle comet for the neopixels is also good, uploaded the sketch and it’s a nice idle animation. You rock!

@mightyani: Thanks for all your help so far as well, I knew the basic library and uploading example sketch to the arduino and doing minor edits to example code, but I’m not seasoned enough to write new code or go from scratch. Unfortunately for the time frame I have I can’t really do enough research to do coding. You said you’d help writing a sketch to his specifications and if you could you’d also rock very much :slight_smile:

The people here at GBFans are amazing!

For a really quick solution to your problem, I’ve got a bit of a sketch from my lightsaber build that I think we can splice into Tommyb’s “red comet” sketch so that your NeoPixels will flash crazy blue and white when you hold down a momentary button and then go back to comets when the button is released. I think we can also just lift the code from the NeoPixel library’s example and jam it in there, too.

Give me a few days and I should have a full sketch you can just copy and paste to your IDE.

Thanks for your patience~~ :love:

Alright everyone, I’ve got a lot of cool stuff cooking up over here, if you’d just like to turn your heads, uhhhhhhh:

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

#define PIXELDATAPIN 6
#define NUMPIXELS 60
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 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)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIXELDATAPIN, NEO_GRB + NEO_KHZ800);

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.

const int buttonPin = 2;		//The input pin is where the pushbutton switch is located

int val;					//This variable stores the state of the input pin
int buttonState = 0;		//Store the state of the switch
int flashMode = 0;			//0 means the LEDs are doing red comets...
						//...and 1 means the LEDs are flashing hues of blue and white

int delayval;				//How quick will blue and white flash?
int r, g, b;
int low = 0;				//The bottom of the color range
int range = 255;			//The spread of the color range
int delayshort = 20;		//Fast flashing, 20 ms delay
int delaylong = 50;			//Slower flashing, 40 ms delay

// NOTE
// NUMBER_COMETS x (COMET_LENGTH + COMET_SPACING) must be <= TOTAL_COMET_PIXELS
// The number of pixels in each comet
#define COMET_LENGTH 12
// The number of comets
#define NUMBER_COMETS 3
// The number of pixels between each comet
#define COMET_SPACING 8
// The total number of pixels in the strip dedicated to comets
#define TOTAL_COMET_PIXELS 60
// The direction of the comet 0 or 1
#define COMET_DIRECTION 1
// The max comet brightness
#define MAX_COMET_BRIGHTNESS 255
// The comet speed
#define SPEED 60

void setup() {
	// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
	if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
	// End of trinket special code
	pinMode(buttonPin, INPUT);		//Tell the Arduino the pushbutton is an input

	Serial.begin(9600); //open the serial port at 9600 bps:
	strip.begin();		//Initialize the NeoPixel library
	strip.show();		//Initialize all pixels to 'off'

	buttonState = digitalRead(buttonPin);	//Read the initial state of the pushbutton

	randomSeed(analogRead(0));

	InitComet();
}

byte rgbyRedLevels[NUMPIXELS];

void InitComet(){
	int iIndex = 0;
	byte byMasterPos = 0;
	byte byCometIndex = 0;
	memset(rgbyRedLevels, 0, NUMPIXELS);

	for (byCometIndex = 0; byCometIndex < NUMBER_COMETS; byCometIndex++){
#if COMET_DIRECTION
		byte byBrightness = 0;
#else
		byte byBrightness = MAX_COMET_BRIGHTNESS;
#endif
		// Dim comet by length
		byte byDim = MAX_COMET_BRIGHTNESS / COMET_LENGTH;

		for (iIndex = 0; iIndex < COMET_LENGTH; iIndex++){
			rgbyRedLevels[byMasterPos++] = byBrightness;
#if COMET_DIRECTION
			byBrightness += byDim;
#else
			byBrightness -= byDim;
#endif
		}
		byMasterPos += COMET_SPACING;
	}
}

#if COMET_DIRECTION
void ProcessCometsDir(){
	byte iIndex = 0;
	byte byLast = 0;
	byte byDestPixel = 0;
	byte byOld = 0;

	byLast = rgbyRedLevels[TOTAL_COMET_PIXELS - 1]; // Preserve the contents of the last pixel

	for (iIndex = TOTAL_COMET_PIXELS - 1; iIndex > 0; iIndex--){
		rgbyRedLevels[iIndex] = rgbyRedLevels[iIndex - 1];
	}
	rgbyRedLevels[0] = byLast; // Put what was the last pixel intio the first

	for (iIndex = 0; iIndex <TOTAL_COMET_PIXELS; iIndex++){
		strip.setPixelColor(iIndex, rgbyRedLevels[iIndex], 0, 0);
	}
	strip.show();
	delay(SPEED);
}

#else
void ProcessCometsDir()
{
	byte iIndex = 0;
	byte byLast = 0;
	byte byDestPixel = 0;
	byte byOld = 0;

	byLast = rgbyRedLevels[0]; // Preserve the contents of the last pixel

	for (iIndex = 0; iIndex < TOTAL_COMET_PIXELS - 1; iIndex++)
	{
		rgbyRedLevels[iIndex] = rgbyRedLevels[iIndex + 1];
	}
	rgbyRedLevels[TOTAL_COMET_PIXELS - 1] = byLast; // Put what was the last pixel intio the first

	for (iIndex = 0; iIndex <TOTAL_COMET_PIXELS; iIndex++)
	{
		strip.setPixelColor(iIndex, rgbyRedLevels[iIndex], 0, 0);
	}
	strip.show();
	delay(SPEED);
}
#endif

void BlueWhiteFlashing() {
	//Randomly choose the color the NeoPixels will have while the pushbutton switch is pressed
	//Take that color and apply it to all NeoPixels
	r = low + random(0, 100);		//The red channel.  Brightness goes between 0 (off) and its
								//contribution to white, 100.
	g = r;						//The green channel, same as red
	b = random(25, 150);			//The blue channel.  Want to have a lot of blues.

	//For a set of NeoPixels the first NeoPixel is 0, the second is 1, all the way up to
	//the count of NeoPixels, minus one.
	for (int i = 0; i < NUMPIXELS; i++) {
		//RGB values from a minimum of (0, 0, 0) up to a maximum of (255, 255, 255)
		strip.setPixelColor(i, strip.Color(r, g, b));	//Pulse the NeoPixels, hues of blue
	}
	strip.show();		//Send the updated pixel color out to the NeoPixel ring

	delayval = random(delayshort, delaylong);
	delay(delayval);	//Delay for a period of time before the next flash, in milliseconds

}

void loop() {

	val = digitalRead(buttonPin);		//Read the state of the pushbutton and store it in val

	if (val == HIGH) {			//If the button is not pressed down...
		flashMode = 0;			//...then we should be seeing red comets
	} else if (val == LOW) {		//But if the button IS pressed down
		flashMode = 1;			//...we need to queue up the blue and white flashes.
	}

	if (flashMode == 0) {
		ProcessCometsDir();
	}

	if (flashMode == 1) {		//When the button IS pressed down and flashMode is on...
		BlueWhiteFlashing();	//...show blue and white flashes.

	}

	buttonState = val;				//Save the pushbutton's new state as our variable so we can check it on the next loop.
}

I took some of tommysb’s code from above and added in a random flashing of the NeoPixels between white and different hues of blue.

***Hook the NeoPixel data line up to pin 6 on your Uno.

***To initiate the flashing, you need to have a momentary pushbutton switch connected to pin 2 on your Uno. Don’t forget the appropriate resistors coming off your switch: a 10 kiloohm one between your switch and +5V, and a 100 ohm one between your switch and pin 2, with a lead to GND on the same pin side as the 10 kiloohm resistor, like this

image

Mind you, I only tested this code with a NeoPixel 60 ring, so I haven’t seen its behavior with the Jewel added in. It shouldn’t be a problem, just change NUMPIXELS to 67 instead of 60 and hook up the ring and Jewel in series through their “data in” and “data out” soldering pads.

I’d love feedback about this sketch, and many thanks to tommyb for doing the heavy lifting on the red comet part of it.

EDIT: Crud. I forgot about the rainbow startup part. Will add that in later, but I wanted you to have this part of the code now since I know you’re under a time crunch.

can the lights with this code handle the power straight off the uno or do I need a dedicated power straight to the lights for it ?

Also your awsome thanks so much. the crunch is getting to me lol

I connected the NeoPixel ring right into the +5V and GND headers on my Uno.

Thank you much just wanted to make sure.

This has been a big help, got the code up and running and looks great so far! (After a big snafu with the switch but godspeed helped me figure that one out)

Alright, here it is with a rainbow color startup/reset animation. I just took some code from the NeoPixels “strandtest” example, modified it a bit, and jammed it into my and tommyb’s code from the post above.

Enjoy!

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

#define PIXELDATAPIN 6
#define NUMPIXELS 60
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 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)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIXELDATAPIN, NEO_GRB + NEO_KHZ800);

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.

const int buttonPin = 2;		//The input pin is where the pushbutton switch is located

int val;					//This variable stores the state of the input pin
int buttonState = 0;		//Store the state of the switch
int flashMode = 0;			//0 means the LEDs are doing red comets...
						//...and 1 means the LEDs are flashing hues of blue and white

int delayval;				//How quick will blue and white flash?
int r, g, b;
int low = 0;				//The bottom of the color range
int range = 255;			//The spread of the color range
int delayshort = 20;		//Fast flashing, 20 ms delay
int delaylong = 50;			//Slower flashing, 40 ms delay

// NOTE
// NUMBER_COMETS x (COMET_LENGTH + COMET_SPACING) must be <= TOTAL_COMET_PIXELS
// The number of pixels in each comet
#define COMET_LENGTH 12
// The number of comets
#define NUMBER_COMETS 3
// The number of pixels between each comet
#define COMET_SPACING 8
// The total number of pixels in the strip dedicated to comets
#define TOTAL_COMET_PIXELS 60
// The direction of the comet 0 or 1
#define COMET_DIRECTION 1
// The max comet brightness
#define MAX_COMET_BRIGHTNESS 255
// The comet speed
#define SPEED 60

void setup() {
	// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
	if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
	// End of trinket special code
	pinMode(buttonPin, INPUT);		//Tell the Arduino the pushbutton is an input

	Serial.begin(9600); //open the serial port at 9600 bps:
	strip.begin();		//Initialize the NeoPixel library
	strip.show();		//Initialize all pixels to 'off'

	buttonState = digitalRead(buttonPin);	//Read the initial state of the pushbutton

	randomSeed(analogRead(0));

	rainbow(30);

	InitComet();
}

byte rgbyRedLevels[NUMPIXELS];

void InitComet(){
	int iIndex = 0;
	byte byMasterPos = 0;
	byte byCometIndex = 0;
	memset(rgbyRedLevels, 0, NUMPIXELS);

	for (byCometIndex = 0; byCometIndex < NUMBER_COMETS; byCometIndex++){
#if COMET_DIRECTION
		byte byBrightness = 0;
#else
		byte byBrightness = MAX_COMET_BRIGHTNESS;
#endif
		// Dim comet by length
		byte byDim = MAX_COMET_BRIGHTNESS / COMET_LENGTH;

		for (iIndex = 0; iIndex < COMET_LENGTH; iIndex++){
			rgbyRedLevels[byMasterPos++] = byBrightness;
#if COMET_DIRECTION
			byBrightness += byDim;
#else
			byBrightness -= byDim;
#endif
		}
		byMasterPos += COMET_SPACING;
	}
}

#if COMET_DIRECTION
void ProcessCometsDir(){
	byte iIndex = 0;
	byte byLast = 0;
	byte byDestPixel = 0;
	byte byOld = 0;

	byLast = rgbyRedLevels[TOTAL_COMET_PIXELS - 1]; // Preserve the contents of the last pixel

	for (iIndex = TOTAL_COMET_PIXELS - 1; iIndex > 0; iIndex--){
		rgbyRedLevels[iIndex] = rgbyRedLevels[iIndex - 1];
	}
	rgbyRedLevels[0] = byLast; // Put what was the last pixel intio the first

	for (iIndex = 0; iIndex <TOTAL_COMET_PIXELS; iIndex++){
		strip.setPixelColor(iIndex, rgbyRedLevels[iIndex], 0, 0);
	}
	strip.show();
	delay(SPEED);
}

#else
void ProcessCometsDir()
{
	byte iIndex = 0;
	byte byLast = 0;
	byte byDestPixel = 0;
	byte byOld = 0;

	byLast = rgbyRedLevels[0]; // Preserve the contents of the last pixel

	for (iIndex = 0; iIndex < TOTAL_COMET_PIXELS - 1; iIndex++)
	{
		rgbyRedLevels[iIndex] = rgbyRedLevels[iIndex + 1];
	}
	rgbyRedLevels[TOTAL_COMET_PIXELS - 1] = byLast; // Put what was the last pixel intio the first

	for (iIndex = 0; iIndex <TOTAL_COMET_PIXELS; iIndex++)
	{
		strip.setPixelColor(iIndex, rgbyRedLevels[iIndex], 0, 0);
	}
	strip.show();
	delay(SPEED);
}
#endif

void BlueWhiteFlashing() {
	//Randomly choose the color the NeoPixels will have while the pushbutton switch is pressed
	//Take that color and apply it to all NeoPixels
	r = low + random(0, 100);		//The red channel.  Brightness goes between 0 (off) and its
								//contribution to white, 100.
	g = r;						//The green channel, same as red
	b = random(25, 150);			//The blue channel.  Want to have a lot of blues.

	//For a set of NeoPixels the first NeoPixel is 0, the second is 1, all the way up to
	//the count of NeoPixels, minus one.
	for (int i = 0; i < NUMPIXELS; i++) {
		//RGB values from a minimum of (0, 0, 0) up to a maximum of (255, 255, 255)
		strip.setPixelColor(i, strip.Color(r, g, b));	//Pulse the NeoPixels, hues of blue
	}
	strip.show();		//Send the updated pixel color out to the NeoPixel ring

	delayval = random(delayshort, delaylong);
	delay(delayval);	//Delay for a period of time before the next flash, in milliseconds

}

void rainbow(int wait) {
	uint16_t i, j;
	for (j = 0; j < 256; j++){
		for (i = 0; i < NUMPIXELS; i++) {
			strip.setPixelColor(i, Wheel(j & 255));
		}
	strip.show();
	delay(wait);
	}
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
	WheelPos = 245 - WheelPos;
	if (WheelPos < 85) {
		return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
	}
	if (WheelPos < 170) {
		WheelPos -= 85;
		return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
	}
	WheelPos -= 170;
	return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

void loop() {

	val = digitalRead(buttonPin);	//Read the state of the pushbutton and store it in val

	if (val == HIGH) {			//If the button is not pressed down...
		flashMode = 0;			//...then we should be seeing red comets
	} else if (val == LOW) {		//But if the button IS pressed down
		flashMode = 1;			//...we need to queue up the blue and white flashes.
	}

	if (flashMode == 0) {
		ProcessCometsDir();
	}

	if (flashMode == 1) {		//When the button IS pressed down and flashMode is on...
		BlueWhiteFlashing();	//...show blue and white flashes.
	}

	buttonState = val;			//Save the pushbutton's new state as our variable so we can check it on the next loop.
}

Hello

First of all, Thank you for every person who share their codes !!! It’s really impressive for beginners !

I have a little question. Can someone post a video of the result of the last code ? It’s a bit difficult to imagine the result.

THANKS

@MightyAni : You are a lifesaver. The code works perfectly and I have finally completed setting up the electronics. I don’t know how to thank you enough.

@tataioioioio: I didn’t get a video of it in action yet but I’m sure GodSpeed will make a video of it when he’s done assembling everything together

image

Hello

Ones again thank you for all your codes.

I have a little question about this one.

It works fine, but I have a little problem.

At start you have " Who ya gonna call? Ghostbusters!" scrolling one the 6 digit display, and this is really great.

After that you have a loop and the values goes from 12999 through 12000.

But when the loop start again automatically, the text " Who ya gonna call? Ghostbusters!"scrolling again.

Is it possible to have the text just at start and only have numbers in the loop ?

I’ve try many things but it never works.

Thank you for your futur answers.

Thanks so much for all the help!

I have it mostly completed with a couple of pieces here and there.

After all the work I am pleased.

Though some thinks like the gun I wish was a little better and I wish I had that awesome startup sound that a couple of people have used on theirs.

https://youtu.be/wA1-qJ4t16E

https://www.youtube.com/watch?v=https://youtu.be/wA1-qJ4t16E

image

![image](http://www.gbfans.com/images/pb/GodSpeed13/SAM_0825 - Copy_zpszkxeyixr.jpg)

Thank you godspeed.

Can you post a video to see the lights at the start of your pack ?

Please

Holy crap that is amazing. How did you make the guns pop out? The programming is great too. Love the lights.

Great job! Looks badass.

If I am understanding correctly, try this code:

#include <GhostLab42Reboot.h>
#include <Wire.h>

GhostLab42Reboot reboot;

void setup()
{
	reboot.begin();
	reboot.write(1, "126.2");
	reboot.write(2, "-42.9");

	// Turn down the brightness of the main displays
	reboot.setDisplayBrightness(0, 60);
	reboot.setDisplayBrightness(1, 100);
	reboot.setDisplayBrightness(2, 60);

	// String to be scrolled across the six digit display
	// Need the extra spaces to make the scrolling smooth
	String displayText = "      Who ya gonna call?     Ghostbusters!      ";

	// A NOTE ABOUT SCROLLING:
	// This works fine if there are not any periods/decimals, since a period/decimal
	// is either considered part of the previous character or its own character if
	// it is in the first position of the display (in which case there is technically
	// a "space" in front of it)
	// Check out ex4_scrollingtextadvanced instead if you are planning on scrolling a
	// string with a period/decimal

	// Commence scrolling
	for (int i = 0; i < displayText.length(); i++)
	{
		reboot.write(0, displayText.substring(i, i + 6));
		delay(250);
	}

	// Clear and start over
	reboot.resetDisplay(0);
}

void loop()
{

	String countStr;
	int count = 2087;

	for (int i = 0; i < 1000; i++)
	{
		// Count down
		reboot.write(0, String(120999 - i));

		// Count up with leading 0s really fast
		countStr = "000" + String(16 * i);
		reboot.write(1, countStr.substring(countStr.length() - 4));

		// Show a number that is about 2087 but moves around randomly by a few counts
		// Slow the update down so it changes more slowly
		if ((i % 30) == 0)
		{
			count = 2087 + random(-2, 3);
		}

		reboot.write(2, String(count));

		delay(30);
	}
}

I moved the Who You Gonna Call text up into the setup part of the code, as it only runs once, on start up.

I don’t have my 6 digit displays hooked up yet, so please let me know if this doesn’t work. I was not able to test it.

MightyAni

I have an other question.

WILL YOU MARY ME ? XD

That’s just the perfection THANK YOU SOOOOO MUSH