knight rider scanner
First of all I don't know if you were making a statement about the way I have my "wires hanging down" or if it was just a statement about mods and the people moding in general. I assure you that when i am DONE with every thing it will be mounted and the wires will be ran properly. I have some other cosmetic issues and i am working on defusing the light better so i don't have the DOT look. This is all done easier with out having the box mounted.
Your "Homemade scanner" is a night raider light that any one can buy from Plasmaglow. I had one in my Roush Hood scoop. My "Homemade Scanner" IS scratch built. Each LED chained together with 12 solder joints. The issue with people that want this light is the company that made the light for the show want $3-4k for it. So The only realistic Options(for normal people anyway) is to make your own or mount 2 Night raider lights. I chose to try my hand at my 1st electrical project of this nature, and yes it does need work but i feel it is one of more versatile light bars out there as far as colors, speed ajust ment and fade afect.
the major issue with my light is the coding and how you adjust the parameters of the light If there was a program that could do this with out going through the codes then this would be ideal.
O Yah the fact that i got a call from the Company that made the light for the show, says a little about it.
Your "Homemade scanner" is a night raider light that any one can buy from Plasmaglow. I had one in my Roush Hood scoop. My "Homemade Scanner" IS scratch built. Each LED chained together with 12 solder joints. The issue with people that want this light is the company that made the light for the show want $3-4k for it. So The only realistic Options(for normal people anyway) is to make your own or mount 2 Night raider lights. I chose to try my hand at my 1st electrical project of this nature, and yes it does need work but i feel it is one of more versatile light bars out there as far as colors, speed ajust ment and fade afect.
the major issue with my light is the coding and how you adjust the parameters of the light If there was a program that could do this with out going through the codes then this would be ideal.
O Yah the fact that i got a call from the Company that made the light for the show, says a little about it.
If I may suggest a good product in order to keep the low voltage and simplicity of LED's, but also remove the ugly dots (from the 3-5mm LEDs) and give a much more flush and fluid/solid looking flow of light.
SMD LEDs. (Here's a LINK) You can make multiple rows of these and wire together. With enough of them you can have it look more fluid like the actual Knight Rider scanner.
SMD LEDs. (Here's a LINK) You can make multiple rows of these and wire together. With enough of them you can have it look more fluid like the actual Knight Rider scanner.
It would be nice to have the those leds. but then your back to increasing costs especially if you want to do multiple rows. I have 44 LED in my bars, 22 pre side. Costing around $175. With the SMD led your looking at $250-300 for 2 rows. Then there is the electronics that are need to to control them. My program board and power power boards fit in a 4x4x1.5 box. Talking to Auto Indulgence(the guys that made the light for the show) there board is considerably larger. I wanted to make the board small so i could mount it to the bottom side of the hood, this way i only have to run 2 wires down the hood and the hinge. If its any larger it would look MORE tacky then it does and could not be mounted to the hood. also My light can be any color i want. That is a big plus to me.
All i am using is a arduino Duemilanove and two Step Down DC/DC Converter to supply 6.5v.
I am using 1 to supply voltage to the board and the right side of the light and the other to injects power to the left side of the light.
I am using 1 to supply voltage to the board and the right side of the light and the other to injects power to the left side of the light.
sounds like a brillantly simple design.
however if you want to vary how the leds light up you are going to have to go to microcontroller or gate array. I have some experience with these, so if you want help let me know.
however if you want to vary how the leds light up you are going to have to go to microcontroller or gate array. I have some experience with these, so if you want help let me know.
you will be arrested if a cop see's you driving with this on .....no if and or but......I am a firemen i deal with these dick heads all day long .....and if they pull there head out of there asses long enough to figure out you car is a clone not the real deal there gonna really stick it to you for spite.....i have been on several call and heard cops brag about towing nice cars .....good luck and be smart
Please dont take this the wrong way I am just starting out with this stuff so i dont understand the possibility or limitations of this stuff
What do you mean by vary how the leds light up. Here is the code i am working with. I have the key stuff commented to help follow.
With the code i could have just 1 led go left to right treating it like it was a single light and not 2 individual lights. or i could have 1 led in both the left and right scoop scanning back and forth.. OR i could just have 1 massively long old school Knight Rider scanner where it would go back and forth with out regards to a left and right just one large bar.
thanks for any in site you might give me in advance. I am always eager to learn new stuff
#define clockpin 13 // CI
#define datapin 11 // DI
#define enablepin 10 // EI
#define latchpin 9 // LI
#define NumLEDs 21 //LEDs PER SIDE
#define CenterWidth 18 //Number of LED not including Trailing andv leading edges
int LEDChannels[NumLEDs * 2][3] = {0};
int SB_CommandMode;
int SB_RedCommand;
int SB_GreenCommand;
int SB_BlueCommand;
// these are small so i'll leave them in RAM, larger data should be moved to PROGMEM
int KittLeadingEdge[] = { 750,550, 350, 200, 100, 50}; //LED Brightness values for edge
int KittTrailingEdge[] = {50, 100, 200, 350, 550, 850};
int KittLeadSize = sizeof(KittLeadingEdge) / sizeof(int);
int KittTrailSize = sizeof(KittTrailingEdge) / sizeof(int);
int KittTotalSize = KittLeadSize + KittTrailSize + CenterWidth;
void setup() {
pinMode(datapin, OUTPUT);
pinMode(latchpin, OUTPUT);
pinMode(enablepin, OUTPUT);
pinMode(clockpin, OUTPUT);
SPCR = (1<<SPE)|(1<<MSTR)|(0<<SPR1)|(0<<SPR0);
digitalWrite(latchpin, LOW);
digitalWrite(enablepin, LOW);
}
void SB_SendPacket() {
if (SB_CommandMode == B01) {
SB_RedCommand = 127;
SB_GreenCommand = 127;
SB_BlueCommand = 127;
}
SPDR = SB_CommandMode << 6 | SB_BlueCommand>>4;
while(!(SPSR & (1<<SPIF)));
SPDR = SB_BlueCommand<<4 | SB_RedCommand>>6;
while(!(SPSR & (1<<SPIF)));
SPDR = SB_RedCommand << 2 | SB_GreenCommand>>8;
while(!(SPSR & (1<<SPIF)));
SPDR = SB_GreenCommand;
while(!(SPSR & (1<<SPIF)));
}
void WriteLEDArray() {
SB_CommandMode = B00; // Write to PWM control registers
for (int h = 0;h<NumLEDs*2;h++) {
SB_RedCommand = LEDChannels[h][0];
SB_GreenCommand = LEDChannels[h][1];
SB_BlueCommand = LEDChannels[h][2];
SB_SendPacket();
}
delayMicroseconds(15);
digitalWrite(latchpin,HIGH); // latch data into registers
delayMicroseconds(15);
digitalWrite(latchpin,LOW);
SB_CommandMode = B01; // Write to current control registers
for (int z = 0; z < NumLEDs*2; z++) SB_SendPacket();
delayMicroseconds(15);
digitalWrite(latchpin,HIGH); // latch data into registers
delayMicroseconds(15);
digitalWrite(latchpin,LOW);
}
// Re-use my old array rotating code, but use collapsed fake array to save memory
// (at expense of CPU)
int KittFakeArray(int index) {
if (index >= 0 && index < KittTrailSize) {
return KittTrailingEdge[index];
} else if (index >= KittTrailSize && index < (CenterWidth + KittTrailSize)) {
return 1023;
} else if (index >= (CenterWidth + KittTrailSize) && index < KittTotalSize) {
return KittLeadingEdge[index-CenterWidth-KittTrailSize];
} else {
return 0;
}
}
void NewKittFill(int dir, int FillSpeed, int FadeSteps, int red, int green, int blue) {
int KittFadeFactor = 0;
int revIndex;
for (int FillCount = 0; FillCount < (KittTotalSize+NumLEDs); FillCount++) {
for (int FadeCount = 0; FadeCount < FadeSteps; FadeCount++) {
for (int i = 0; i < NumLEDs; i++) {
KittFadeFactor = ((KittFakeArray(KittTotalSize - FillCount + i)) * (FadeSteps - FadeCount - 1) + (KittFakeArray(KittTotalSize - FillCount - 1 + i)) * (FadeCount)) / (1 * FadeSteps);
if (dir == 0) {
LEDChannels[i][0] = (long) red * KittFadeFactor / 1023;
LEDChannels[i][1] = (long) green * KittFadeFactor / 1023;
LEDChannels[i][2] = (long) blue * KittFadeFactor / 1023;
revIndex = NumLEDs * 2 - i - 1;
LEDChannels[revIndex][0] = LEDChannels[i][0];
LEDChannels[revIndex][1] = LEDChannels[i][1];
LEDChannels[revIndex][2] = LEDChannels[i][2];
} else {
revIndex = NumLEDs - 1 - i;
LEDChannels[revIndex][0] = (long) red * KittFadeFactor / 1023;
LEDChannels[revIndex][1] = (long) green * KittFadeFactor / 1023;
LEDChannels[revIndex][2] = (long) blue * KittFadeFactor / 1023;
LEDChannels[NumLEDs + i][0] = LEDChannels[revIndex][0];
LEDChannels[NumLEDs + i][1] = LEDChannels[revIndex][1];
LEDChannels[NumLEDs + i][2] = LEDChannels[revIndex][2];
}
}
WriteLEDArray();
delay(20);
}
}
}
void loop() {
NewKittFill(0, 7, 7, 0, 0, 1023); //blue Direction, Speed, Fade speed, red, green, blue
NewKittFill(1, 5, 6, 0, 0, 1023);//blue
NewKittFill(0, 7, 7, 1023, 0, 0); //red
NewKittFill(1, 5, 6, 1023, 0, 0);//red
NewKittFill(0, 7, 7, 0, 1023, 0);//green
NewKittFill(1, 5, 6, 0, 1023, 0);//green
}
What do you mean by vary how the leds light up. Here is the code i am working with. I have the key stuff commented to help follow.
With the code i could have just 1 led go left to right treating it like it was a single light and not 2 individual lights. or i could have 1 led in both the left and right scoop scanning back and forth.. OR i could just have 1 massively long old school Knight Rider scanner where it would go back and forth with out regards to a left and right just one large bar.
thanks for any in site you might give me in advance. I am always eager to learn new stuff
#define clockpin 13 // CI
#define datapin 11 // DI
#define enablepin 10 // EI
#define latchpin 9 // LI
#define NumLEDs 21 //LEDs PER SIDE
#define CenterWidth 18 //Number of LED not including Trailing andv leading edges
int LEDChannels[NumLEDs * 2][3] = {0};
int SB_CommandMode;
int SB_RedCommand;
int SB_GreenCommand;
int SB_BlueCommand;
// these are small so i'll leave them in RAM, larger data should be moved to PROGMEM
int KittLeadingEdge[] = { 750,550, 350, 200, 100, 50}; //LED Brightness values for edge
int KittTrailingEdge[] = {50, 100, 200, 350, 550, 850};
int KittLeadSize = sizeof(KittLeadingEdge) / sizeof(int);
int KittTrailSize = sizeof(KittTrailingEdge) / sizeof(int);
int KittTotalSize = KittLeadSize + KittTrailSize + CenterWidth;
void setup() {
pinMode(datapin, OUTPUT);
pinMode(latchpin, OUTPUT);
pinMode(enablepin, OUTPUT);
pinMode(clockpin, OUTPUT);
SPCR = (1<<SPE)|(1<<MSTR)|(0<<SPR1)|(0<<SPR0);
digitalWrite(latchpin, LOW);
digitalWrite(enablepin, LOW);
}
void SB_SendPacket() {
if (SB_CommandMode == B01) {
SB_RedCommand = 127;
SB_GreenCommand = 127;
SB_BlueCommand = 127;
}
SPDR = SB_CommandMode << 6 | SB_BlueCommand>>4;
while(!(SPSR & (1<<SPIF)));
SPDR = SB_BlueCommand<<4 | SB_RedCommand>>6;
while(!(SPSR & (1<<SPIF)));
SPDR = SB_RedCommand << 2 | SB_GreenCommand>>8;
while(!(SPSR & (1<<SPIF)));
SPDR = SB_GreenCommand;
while(!(SPSR & (1<<SPIF)));
}
void WriteLEDArray() {
SB_CommandMode = B00; // Write to PWM control registers
for (int h = 0;h<NumLEDs*2;h++) {
SB_RedCommand = LEDChannels[h][0];
SB_GreenCommand = LEDChannels[h][1];
SB_BlueCommand = LEDChannels[h][2];
SB_SendPacket();
}
delayMicroseconds(15);
digitalWrite(latchpin,HIGH); // latch data into registers
delayMicroseconds(15);
digitalWrite(latchpin,LOW);
SB_CommandMode = B01; // Write to current control registers
for (int z = 0; z < NumLEDs*2; z++) SB_SendPacket();
delayMicroseconds(15);
digitalWrite(latchpin,HIGH); // latch data into registers
delayMicroseconds(15);
digitalWrite(latchpin,LOW);
}
// Re-use my old array rotating code, but use collapsed fake array to save memory
// (at expense of CPU)
int KittFakeArray(int index) {
if (index >= 0 && index < KittTrailSize) {
return KittTrailingEdge[index];
} else if (index >= KittTrailSize && index < (CenterWidth + KittTrailSize)) {
return 1023;
} else if (index >= (CenterWidth + KittTrailSize) && index < KittTotalSize) {
return KittLeadingEdge[index-CenterWidth-KittTrailSize];
} else {
return 0;
}
}
void NewKittFill(int dir, int FillSpeed, int FadeSteps, int red, int green, int blue) {
int KittFadeFactor = 0;
int revIndex;
for (int FillCount = 0; FillCount < (KittTotalSize+NumLEDs); FillCount++) {
for (int FadeCount = 0; FadeCount < FadeSteps; FadeCount++) {
for (int i = 0; i < NumLEDs; i++) {
KittFadeFactor = ((KittFakeArray(KittTotalSize - FillCount + i)) * (FadeSteps - FadeCount - 1) + (KittFakeArray(KittTotalSize - FillCount - 1 + i)) * (FadeCount)) / (1 * FadeSteps);
if (dir == 0) {
LEDChannels[i][0] = (long) red * KittFadeFactor / 1023;
LEDChannels[i][1] = (long) green * KittFadeFactor / 1023;
LEDChannels[i][2] = (long) blue * KittFadeFactor / 1023;
revIndex = NumLEDs * 2 - i - 1;
LEDChannels[revIndex][0] = LEDChannels[i][0];
LEDChannels[revIndex][1] = LEDChannels[i][1];
LEDChannels[revIndex][2] = LEDChannels[i][2];
} else {
revIndex = NumLEDs - 1 - i;
LEDChannels[revIndex][0] = (long) red * KittFadeFactor / 1023;
LEDChannels[revIndex][1] = (long) green * KittFadeFactor / 1023;
LEDChannels[revIndex][2] = (long) blue * KittFadeFactor / 1023;
LEDChannels[NumLEDs + i][0] = LEDChannels[revIndex][0];
LEDChannels[NumLEDs + i][1] = LEDChannels[revIndex][1];
LEDChannels[NumLEDs + i][2] = LEDChannels[revIndex][2];
}
}
WriteLEDArray();
delay(20);
}
}
}
void loop() {
NewKittFill(0, 7, 7, 0, 0, 1023); //blue Direction, Speed, Fade speed, red, green, blue
NewKittFill(1, 5, 6, 0, 0, 1023);//blue
NewKittFill(0, 7, 7, 1023, 0, 0); //red
NewKittFill(1, 5, 6, 1023, 0, 0);//red
NewKittFill(0, 7, 7, 0, 1023, 0);//green
NewKittFill(1, 5, 6, 0, 1023, 0);//green
}


