Forum Index > Projects > Larson Scanner kit and LED Menorah kit support
 Use five LED's instead of nine.
 |  Printable Version
By: Anonymous: Chris () on Friday, February 17 2012 @ 11:54 PM PST (Read 1998 times)  
Anonymous: Chris

Hi there, I'm lovin' this kit. I've been playing around with avrdude to try and reprogram the chip to do only 5 led's instead of nine. I can't say I'm the greatest coder in the world so I'm obviously missing something in parts of the code. I changed what I thought should be changed but I must be doing something wrong because it doesn't work after the changes. Would it be possible to assist me with which lines I should change in the larson_14 code to utilize 5 leds? I know there was a previous version that used less leds. Even if I could compare that code, I could probably figure it out. Thanks very much for your help...

Chris





       
   
By: Windell (offline) on Saturday, February 18 2012 @ 06:52 PM PST  
Windell

We have not made a version of the code for just five LEDs. Depending on what you need to do, you might consider just building it with the central five LEDs-- would that work OK?


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: Anonymous: Chris () on Sunday, February 19 2012 @ 01:03 AM PST  
Anonymous: Chris

Thanks. If I'm understanding, you mean just using the five inner leds and removing the outer ones? What I was trying to do was to reprogram the chip to take them out of the loop. I think if I take the outer ones out, it would create a big delay when it goes back and forth so I thought I needed to remove the code for those ones. I thought I had removed/changed the correct lines in the code but it didn't seem to work... o well...





       
   
By: Anonymous: Chris () on Sunday, February 19 2012 @ 01:05 AM PST  
Anonymous: Chris

Also, I think I saw somewhere where there was a version that used less led's. Is that code somewhere in an archive so I can look at it?





       
   
By: Windell (offline) on Sunday, February 19 2012 @ 11:29 AM PST  
Windell

Also, I think I saw somewhere where there was a version that used less led's. Is that code somewhere in an archive so I can look at it?

Again, we have not made anything like this.


To modify the code:

First, notice that it's designed to sweep past through 9 LEDs, where the "eye" position is given by a variable. It check to see when it's made it far enough using this line of code:

PHP Formatted Code
if (position >= 128)



Try changing that to a lower value; try 72 for starters, and play with it a bit to fine-tune it.

I believe that you'll also need to change where it says:

PHP Formatted Code
                ILED = (127 - position) >> 4;  
                MLED = (127 - position)  - (ILED << 4);

to use (say) 71 - position, instead, according to how you change the turn-around point above.


Those two changes should restrict the Larson Scanner to use the first five LEDs, not the full nine. Then, to map those onto the *middle* five, find this part:

PHP Formatted Code
                                LED0 = LEDs[0];
                                LED1 = LEDs[1];
                                LED2 = LEDs[2];
                                LED3 = LEDs[3];
                                LED4 = LEDs[4];
                                LED5 = LEDs[5];
                                LED6 = LEDs[6];
                                LED7 = LEDs[7];
                                LED8 = LEDs[8];  



Change it to:

PHP Formatted Code
                                LED0 = 0;
                                LED1 = 0;
                                LED2 = LEDs[0];
                                LED3 = LEDs[1];
                                LED4 = LEDs[2];
                                LED5 = LEDs[3];
                                LED6 = LEDs[4];
                                LED7 = 0;
                                LED8 = 0;  



Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: Anonymous: Chris () on Sunday, February 19 2012 @ 07:47 PM PST  
Anonymous: Chris

Thanks so much! I was totally looking at the wrong section. It looks like I need to brush up on my skills a bit more....





       
   
By: Anonymous: Chris () on Sunday, February 19 2012 @ 11:19 PM PST  
Anonymous: Chris

Thanks for the advice. I can't seem to get the center light to turn off completely when it's moving in one direction. Oh well. I guess it's time to give up...

Thanks again for your help.... Chris





       
   
By: Anonymous: Chris () on Monday, February 20 2012 @ 07:58 AM PST  
Anonymous: Chris

I made a compromise... I basically left the code intact except that I made the speed level 3. Then I removed every other led from the board. I think the effect is exactly what I'm looking for. Sorry for being such a pain and thanks for your help....





       
   



 All times are PDT. The time is now 01:00 PM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to Post 
Filtered HTML Allowed 
Censored Content 

Evil Mad Scientist Forum Archives — Read only!

Please visit our new forums for new discussions.


DIY Hardware for Electronic Art


The Original Egg-Bot Kit


Octolively
Interactive LED kits


Meggy Jr RGB
LED matrix game
development kit.


Business-card sized
AVR target boards


Peggy 2
LED Pegboard kits

My Account






Lost your password?