Help With SMD Led Chaser/Nightrider? For Xbox!

Got a project in mind? Post it in here to get help from the forums. No idea too crazy or mundane!
phenoptix
Competent
PostsCOLON 745
JoinedCOLON Sat Apr 17, 2010 11:25 am

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby phenoptix » Tue Apr 24, 2012 2:32 pm

I think I need to look at my program and schematic again to make sure they match up! If you can try swapping around the pins that are connected to the ATTiny :oops:

iainogil
Mostly Harmless
PostsCOLON 8
JoinedCOLON Fri Apr 20, 2012 2:30 pm

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby iainogil » Tue Apr 24, 2012 3:33 pm

:D

I've tried 24 combinations of the four wires (i think that's all the permutations), still no nice cylon sweep - more like a cylon with a bad hangover!
Last edited by 1 on iainogil, edited 0 times in total.

phenoptix
Competent
PostsCOLON 745
JoinedCOLON Sat Apr 17, 2010 11:25 am

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby phenoptix » Tue Apr 24, 2012 3:42 pm

I think I've changed the wiring diagram to make it more logical and then not updated the code example on here. Just working on it now!

Erm... Have that changed and verified as working now...

CodeColon Select all

/*
* TinyCylon.c
*
* Created: 24/04/2012 16:18:00
*  Author: phenoptix
*/
#include <avr/io.h>

#define OUT_A 3
#define OUT_B 2
#define OUT_C 1
#define OUT_D 0

int main(void)
{
   int i;
   while(1){
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(0);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(1);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(2);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(3);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(4);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(5);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(6);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(7);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(8);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(9);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(10);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(11);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(10);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(9);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(8);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(7);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(6);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(5);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(4);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(3);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(2);
   for(i = 30000; i > 0; i--); // short delay
   LED_ON(1);
   }     
   return 0;
}
//DDRB Config for each LED. Here we need to assign the two "active" pins to switch on each LED.
//Setting the others to inputs which gives them a high impedance state.
//This line states that the information will be a constant, the value will be a character, stored in a list called PINS_ACT that is 12 values long (0-11)
const char PINS_ACT[12] = {
( 1<<OUT_A | 1<<OUT_D ),//LED0
( 1<<OUT_A | 1<<OUT_C ),//LED1
( 1<<OUT_A | 1<<OUT_B ),//LED2
( 1<<OUT_B | 1<<OUT_A ),//LED3

( 1<<OUT_B | 1<<OUT_D ),//LED4
( 1<<OUT_B | 1<<OUT_C ),//LED5
( 1<<OUT_C | 1<<OUT_B ),//LED6
( 1<<OUT_C | 1<<OUT_A ),//LED7

( 1<<OUT_C | 1<<OUT_D ),//LED8
( 1<<OUT_D | 1<<OUT_C ),//LED9
( 1<<OUT_D | 1<<OUT_B ),//LED10
( 1<<OUT_D | 1<<OUT_A )//LED11
};


//PORTB Config for each LED. We've already set the active pins now we set which is high.
const char LED_HIGH[12] = {
(1<<OUT_D),//LED0
(1<<OUT_C),//LED1
(1<<OUT_B),//LED2
(1<<OUT_A),//LED2

(1<<OUT_D),//LED4
(1<<OUT_C),//LED5
(1<<OUT_B),//LED6
(1<<OUT_A),//LED7

(1<<OUT_D),//LED8
(1<<OUT_C),//LED9
(1<<OUT_B),//LED10
(1<<OUT_A)//LED11
};

void LED_ON(char LED) { //LED must be from 0 to 11
   DDRB = PINS_ACT[LED];
   PORTB = LED_HIGH[LED];
}

iainogil
Mostly Harmless
PostsCOLON 8
JoinedCOLON Fri Apr 20, 2012 2:30 pm

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby iainogil » Tue Apr 24, 2012 5:12 pm

You sir, are a star!

Works a treat! :D

Thank you so much for your help!

phenoptix
Competent
PostsCOLON 745
JoinedCOLON Sat Apr 17, 2010 11:25 am

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby phenoptix » Tue Apr 24, 2012 6:38 pm

So pleased we got it working! Any pics or vids to share? How old is your daughter? I'm trying to get my daughter interested in electronics, she's 2 years and 3 months!

iainogil
Mostly Harmless
PostsCOLON 8
JoinedCOLON Fri Apr 20, 2012 2:30 pm

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby iainogil » Wed Apr 25, 2012 9:52 am

Yep, all pleased at this end too! My daughter is 6, loves pulling stuff to bits, and thinks it would be a great idea for me to put the knight rider strip on the front of my motorbike! Not sure if that's legal or not!?! :D

I spend most of my time tinkering with physical stuff, this aTtiny thing is a new venture for me and I'm having fun learning new skills!

Here are a couple of videos of things you can control from my website:

http://www.youtube.com/watch?v=WLUp4UpQeGA

http://www.youtube.com/watch?v=BYmPvyyJf5w

The link to the website is in the robot hand video description.

Sounds like you still have plenty of time to convince your daughter how great electronics are! :P

Thanks again for your help!

phenoptix
Competent
PostsCOLON 745
JoinedCOLON Sat Apr 17, 2010 11:25 am

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby phenoptix » Wed Apr 25, 2012 10:05 am

Not sure if the Larson would be legal and I'd probably guess at not legal!
That hand is very cool. I might try to build one myself. I noticed a comment regarding the thumb not being very useful. I'm sure an extra servo to swivel it would fix that!

phenoptix
Competent
PostsCOLON 745
JoinedCOLON Sat Apr 17, 2010 11:25 am

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby phenoptix » Fri Apr 27, 2012 5:22 pm

I've just created a "thing" on thingiverse with all the files used. You can have your own made and even sell them if you want as long as you attribute them to us at phenoptix! http://www.thingiverse.com/thing:22142

Almurray42
Competent
PostsCOLON 293
JoinedCOLON Wed Jun 30, 2010 11:42 pm
LocationCOLON Bridgwater, Somerset, England
CONTACTCOLON

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby Almurray42 » Fri Apr 27, 2012 5:33 pm

phenoptix wroteColonI've just created a "thing" on thingiverse with all the files used. You can have your own made and even sell them if you want as long as you attribute them to us at phenoptix! http://www.thingiverse.com/thing:22142


That's fab! Will be getting some 1206 led's in my order tonight when I get paid! I'll program my ATtiny whilst I'm waiting for the post, and make a vid of the completed board! Very generous of you to leave the designs opensource!
Image
[MOD IT] [OR BIN IT]

phenoptix
Competent
PostsCOLON 745
JoinedCOLON Sat Apr 17, 2010 11:25 am

Re: Help With SMD Led Chaser/Nightrider? For Xbox!

Postby phenoptix » Mon Jun 11, 2012 8:21 pm

I'm hoping that the next iteration is a working board, especially as I've ordered 200 of them. Even if they don't work, the PCB will be blue, so at least that's cool!


Return to

Who is online

Users browsing this forum: 1 and 0 guests