Acidmods

AcidMods Resources ----- ( These are helpful tools for modding ) => Open Source Code & AcidMods Free Code => Topic started by: t0pP8uZz on November 22, 2009, 06:23:26 AM

Title: LED Fader Code
Post by: t0pP8uZz on November 22, 2009, 06:23:26 AM
This is some simple code i wrote on request of a few guys around here... This is a one off project, and i doubt ill update due to the amount of projects im working on atm.

LED Fader Code 00.1
For: PIC12F683

Schematic:
(https://acidmods.com/forum/proxy.php?request=http%3A%2F%2Fi49.tinypic.com%2F35cj5fc.png&hash=7ff63f0cd1fc4fce83a9f11b82fee7cba64a7b90)

This is just a constant fading/breathing effect code, Basically soon as the PIC gets power it will begin its magic.

The breathing/fading effect is only active on pins, 7, 6 and 5.

Instructions:
Connect pin 1 to vdd/+ (MAX 5.5v) use resistors if needed
Connect pin 8 to vss/ground
Connect pin 7,6 and 5 to LED's. You can connect a series of LED's to one pin.

All the pins have diffrent duty cycles.. So theres always fading going on, If you want everything to stay in 'rhythm' then connect all LED's to one pin, thus be pin 7, 6 or 5.

I wouldnt actually use resistors unless your voltage is high.

Also if you want to use ALOT of LED's then you could rig up a transistor to this.

This was a quick project that people requested.. So heres a few more diffrent variations of the fader.. Each one gives a diffrent effect.. One as a fast fade, the other has a slow fade, and the last has a very slow fade..

Downloads:
These links no longer work, try the archive for the fader code download https://www.acidmods.com/forum/index.php/topic,37478.0.html (https://www.acidmods.com/forum/index.php/topic,37478.0.html)
[spoiler]Fast Fade:          http://t0pp8uzz.com/files/FADER.rar (http://t0pp8uzz.com/files/FADER.rar)
Slow Fade:        http://t0pp8uzz.com/files/FADERSlow.rar (http://t0pp8uzz.com/files/FADERSlow.rar)
Very Slow Fade:      http://t0pp8uzz.com/files/FADERVerySlow.rar (http://t0pp8uzz.com/files/FADERVerySlow.rar)[/spoiler]


Information
Since the code uses seperate PWN duty cycles you can alternate them on diffrent pins to create some really nice effects. Check out the videos below that were supplied by spurgurgle. These videos use the "Slow Fade" code. For the pins he used check the post down below.

Red and Blue Fade Change:(submitted by spurgurgle)
fader dome RB.MOV (http://www.youtube.com/watch?v=YxonHzEqP-M#normal)

Red and Yellow Fade Change:(submitted by spurgurgle)
fader dome RY.MOV (http://www.youtube.com/watch?v=cxN06NiliM8#normal)

Green and Blue Fade Change: (submitted by spurgurgle)
fader dome GB.MOV (http://www.youtube.com/watch?v=C5NhIzoCfQI#normal)

PSP Shoulder Buttons (submitted by BIMPtactular)
Psp fading shoulder buttons (http://www.youtube.com/watch?v=7lbmg2lylgw#normal)

Installs:
Spurgurgle's Xbox 360 ROL Fader Install: https://www.acidmods.com/forum/index.php/topic,34129.msg257520.html#new (https://www.acidmods.com/forum/index.php/topic,34129.msg257520.html#new)
Title: Re: LED Fader Code
Post by: spurgurgle on November 22, 2009, 07:13:16 AM
awsome top ur the man lol

i think i'll be testing this in my console in the week....

ill run it off 1 of the usb supply's
and have a constant fading console when its on and or off lol
i think 1 set fading in the top vent
1 set fading i the bottom vents
and the thrid set fading in the fans/ including under my extra fan.....

also 1 question to save me experementing....

+ or - side of the led to legs 7,6 or 5?????????
Title: Re: LED Fader Code
Post by: t0pP8uZz on November 22, 2009, 08:14:54 AM
awsome top ur the man lol

i think i'll be testing this in my console in the week....

ill run it off 1 of the usb supply's
and have a constant fading console when its on and or off lol
i think 1 set fading in the top vent
1 set fading i the bottom vents
and the thrid set fading in the fans/ including under my extra fan.....

also 1 question to save me experementing....

+ or - side of the led to legs 7,6 or 5?????????

heh sounds good!

Well since this uses a PWM kind of approach and a duty cycle.. It needs the + side of the LED to be connected to the pins.

Would be great if we could get the same effect when grounding to the PIC we could run hundreds of led's haha! Not sure how many this will run.. i quickly modified my ABXY chaser circuit, and connected all 4 leds in series to 1 pin. And they seemed fine. Like i said if you wana run alot of LED's from this your gona need to rig up a little circuit with transistors or whatnot.

let us know how it go's

On a side note: About my RF code. Ive just installed the 2 tactiles.. I now have basic rapidfire.. Just need to add the custom speeds, svaing the last used speed to EEPROM, and take care of the LED indicators. Oh and setting the actual custom speed using triggers :-)
Title: Re: LED Fader Code
Post by: spurgurgle on November 22, 2009, 03:52:38 PM
cheers top + side it is.... hopefully with 3 legs to run leds from
i should be able to run 3 set's of 4 or more (fingers crossed)
but i'll find out when i test it out.....

i'll keep my progress with this project posted on here so you can see the full effect of the fader once it is installed in a console...

i think i might use red led's as they are the lowest voltage so i should be able to run more of them and not need a resistor.....

Title: Re: LED Fader Code
Post by: t0pP8uZz on November 22, 2009, 05:18:12 PM
Yeah it should be okay, Also the powersource is obviously constant in the console because its connected to the mains.

Like i said, the 3 pins have indivudual duty cycles.. So whilst one is fading on the other maybe fading on just a little after. This is a method that i used to be able to have the PIC run alot more LED's. But if you dont like the effect try connecting all the LED's to one pin.

Ill try and work out a simple circuit so 1 pin can run 'hell-a-lot' leds  :victory:

On another note..I have football tomorow.. have to get up 7 in the morning! and i wont be back till around 11pm..Also i think im out tuesday too.. Ill still be able to make the occasional post.. But no coding  :confused:

Peace
Title: Re: LED Fader Code
Post by: GhoSt on November 22, 2009, 05:33:45 PM
Sticked this, if you make many more codes we could probably just merge them into one thread. Keep up the work guys and I will try get matt/mike or another admin to get the code onto the sever.

Thank you so much for doing this, I will write some full tutorials and make a circuit diagram for you if you want (last exam is this thursday).

Here you go:
random fade circuit, any mistakes let me know. I will get around to doing a synchronized fade circuit diagram sometime.
(https://acidmods.com/forum/proxy.php?request=http%3A%2F%2Fi49.tinypic.com%2F35cj5fc.png&hash=7ff63f0cd1fc4fce83a9f11b82fee7cba64a7b90)
Title: Re: LED Fader Code
Post by: t0pP8uZz on November 23, 2009, 04:54:57 PM
Ghost! Thanks again for the schematic! Will help alot of people out! Ill update the main post now!

Peace
Title: Re: LED Fader Code
Post by: laxboy on November 24, 2009, 10:25:14 AM
Very nice this adds a nice affect to my computer and my controllers thanks whheno i get the project im working on ill probably ad this thanks againi
Title: Re: LED Fader Code
Post by: Jumbo on November 24, 2009, 12:18:51 PM
Just saw this today and thanks for it. Ill be testing this very soon (1 hour probably lol)

Ill update with how it goes. :D
Title: Re: LED Fader Code
Post by: GhoSt on November 24, 2009, 12:47:21 PM
I tested it today, works all good. I noticed if fades very quickly and I belive the pause when there is no light is to long.
Title: Re: LED Fader Code
Post by: t0pP8uZz on November 24, 2009, 05:09:58 PM
I'll adjust code tomorow.. Give me a idea of what kind of speed yur looking for.
Title: Re: LED Fader Code
Post by: GhoSt on November 24, 2009, 05:23:51 PM
just slow the fade down is it possible to be like a 2 second fade? and if possible reduce/ remove the pause where no light is visible.

cheers, nice little peice of code and I know I am going to use it heaps.
Title: Re: LED Fader Code
Post by: t0pP8uZz on November 25, 2009, 06:33:38 AM
Updated main post!

Heres a few variations of the fader.

Downloads:
Fast Fade:          http://t0pp8uzz.com/files/FADER.rar (http://t0pp8uzz.com/files/FADER.rar)
Slow Fade:        http://t0pp8uzz.com/files/FADERSlow.rar (http://t0pp8uzz.com/files/FADERSlow.rar)
Very Slow Fade:      http://t0pp8uzz.com/files/FADERVerySlow.rar (http://t0pp8uzz.com/files/FADERVerySlow.rar)

When i get more time, Im gona recode the fader. It will have a much better effect. And it will use the CCP pin on the pic.
Title: Re: LED Fader Code
Post by: GhoSt on November 25, 2009, 11:02:50 AM
Cheers dude.

few bugs in the code, see for yourself. I still think it should not fade out completly, since it has a very long pause, and there is a slight jitter in the light before the pause, also if fades on pretty fast. You can't really see the jitter due to my cameras slow frame rate.
acidmods opensource led fader by t0pP8uZz (bug demo) (http://www.youtube.com/watch?v=DtKDSuBJ8No#normal)
Title: Re: LED Fader Code
Post by: t0pP8uZz on November 25, 2009, 03:50:52 PM
The reason for those bugs is because it uses several duty cycles to create a pwm type feature bit on fact those doesn't use pwm ports. I have alot of projects undergo ATM and alot of work ahead of me so updates won't be soo fast. But the next version will use 1 pin thus being the ccp pin to create a nice fade! Be patient i'll update soon!

Peace
Title: Re: LED Fader Code
Post by: spurgurgle on December 22, 2009, 06:22:19 AM
ok so i ada play with this code today.... i used the very slow fade. and after i little testing decided that leg 7 was the smoothest fade.....

here's a little vid of my test.

fader test.MOV (http://www.youtube.com/watch?v=90b3yqevd4M#normal)

so yeah after testing it out i thought of a way to use it in a 360 pad.....
here a link to the thread with it installed in a pad https://www.acidmods.com/forum/index.php/topic,34129.msg257520.html#top (https://www.acidmods.com/forum/index.php/topic,34129.msg257520.html#top)


i have also now messed about with a few different color combinations in a guide button.
using legs 6 and 7 of the chip

Red and Blue
fader dome RB.MOV (http://www.youtube.com/watch?v=YxonHzEqP-M#normal)

Red and Yellow
fader dome RY (http://www.youtube.com/watch?v=cxN06NiliM8#normal)

Green and Blue
fader dome GB (http://www.youtube.com/watch?v=C5NhIzoCfQI#normal)


Title: Re: LED Fader Code
Post by: t0pP8uZz on December 22, 2009, 10:40:43 AM
That looks amazing spurgurle! Great job.

This is exacly what i mean when i said each pin as a seperate PWM duty cycle. You can create a RGB led with any LED.. With a fantastic effect! Id like to see this installed in a controller.

Which leds you using? 3mm?, After xmas im gona get this hooked up in one my pads
Title: Re: LED Fader Code
Post by: spurgurgle on December 22, 2009, 10:49:06 AM
for the dome i was using 5mm as a test.
i found the fade on leg 5 was rather dodgy and not in time with the other 2 so didnt use it.
i think to install this in a dome it would be best to use several 0603's on a small piece of bread board. to get a evan light spread of each color through the dome.


but i think with a small amount of modification to the code this could work asa RBG fader. and would look alot nice if the fade was a little smoother.


Title: Re: LED Fader Code
Post by: t0pP8uZz on December 22, 2009, 11:17:35 AM
Im aware of the issues, And some of them was part of the effect.

As i said before though i have a new customisable LED Fader project that im gona get done pretty soon.. just after xmas/new year probarly.

Instead of downloading the code.. You download a windows application.. In the application you have a virtual LED.. and you adjust a few settings to get the desired effect you want in a virtual live preview.. Then you hit a button and it will generate the code. And that code should be roughly the same as the virtual preview.

Sound good?
Keep it up spur!

Peace
t0pP8uZz
Title: Re: LED Fader Code
Post by: spurgurgle on December 22, 2009, 11:24:34 AM
Instead of downloading the code.. You download a windows application.. In the application you have a virtual LED.. and you adjust a few settings to get the desired effect you want in a virtual live preview.. Then you hit a button and it will generate the code. And that code should be roughly the same as the virtual preview.

Sound good?
Keep it up spur!

Peace
t0pP8uZz

that sounds awsome top.....  :tup:
Title: Re: LED Fader Code
Post by: spurgurgle on December 28, 2009, 09:43:27 AM
i had a quick mess about with this fader code again today. testing it for use in a console.

i tried this RBG fade under a fan
RBG top fade..MOV (http://www.youtube.com/watch?v=uZjM4aSeXwU#normal)


and this is what im doing with it in the console.
https://www.acidmods.com/forum/index.php/topic,34216.new.html#top (https://www.acidmods.com/forum/index.php/topic,34216.new.html#top)

i decided on a Red Blue fade for my console. its work in progress but i will keep that thread updated.
Title: Re: LED Fader Code
Post by: SPARCT on December 29, 2009, 06:18:16 AM
Could you use this code to make the ROL fade like the sickmods product?  I'm thinking it would work, but it would probably require the use of one more pin to detect when the xbox 360 is turned on.  The code could disable the PWM which should effectively kill the fade when the unit is running.

What does everyone else think?  I like the sickmods product, but I'd rather make the mod myself if possible.
Title: Re: LED Fader Code
Post by: spurgurgle on December 29, 2009, 07:04:53 AM
i used this on a 360 controller ROL and it does work

and i will be trying this on a console soon.
Title: Re: LED Fader Code
Post by: t0pP8uZz on December 29, 2009, 07:24:24 AM
i had a quick mess about with this fader code again today. testing it for use in a console.

i tried this RBG fade under a fan
RBG top fade..MOV (http://www.youtube.com/watch?v=uZjM4aSeXwU#normal)


and this is what im doing with it in the console.
https://www.acidmods.com/forum/index.php/topic,34216.new.html#top (https://www.acidmods.com/forum/index.php/topic,34216.new.html#top)

i decided on a Red Blue fade for my console. its work in progress but i will keep that thread updated.

Another nice effect looking good as always spurgurgle!

Will be back in development after new years :-) cant wait!

Peace
Title: Re: LED Fader Code
Post by: SPARCT on December 29, 2009, 08:04:17 AM
i used this on a 360 controller ROL and it does work

and i will be trying this on a console soon.

I'm sorry, but I meant the Ring Of Light on the Xbox 360...not the controller.  I'm pretty sure it would work on the console's ROL, it would just need a way of knowing when to cut off once the console was on.  I'm looking to have the console's ROL fade in and out while the console is off, and then have it switch off once the console is powered so it behaves as normal.

Thanks and sorry for the confusion
Title: Re: LED Fader Code
Post by: spurgurgle on December 29, 2009, 08:35:10 AM
see i dont think this particular fader code will be able to work like the sickmods fader, due to the way the actual ROL works..... its done on some crazy PWM system im not to familar with it.

im currently avin a mess about with a rf module and this fader code and i cant get much to work..... i got the centre power light fading between red and blue when the console is on....  but nuthin like the sick mod chip..... also i think king mike is developing a fader chip for both pad and console check it out  https://www.acidmods.com/forum/index.php/topic,34206.0.html (https://www.acidmods.com/forum/index.php/topic,34206.0.html)
Title: Re: LED Fader Code
Post by: akomismo01 on December 30, 2009, 09:26:31 AM
sorry to interupt but can this be used on a psp?
Title: Re: LED Fader Code
Post by: gamerdude767 on December 30, 2009, 09:28:49 AM
sorry to interupt but can this be used on a psp?
Yes it can! Follow the wiring diagram (at the very top of this page) wire your leds, place them where you want! bam led fader in psp.
Title: Re: LED Fader Code
Post by: spurgurgle on December 30, 2009, 12:14:43 PM
this code works fine in a psp.. matter of fact it'll work in anything. all you need is some leds and a power source and somwhere to fit the chip....

you could use it in something completely random like a fading light in your room or car.
Title: Re: LED Fader Code
Post by: SN!P3R on December 30, 2009, 01:41:36 PM
anyone try this on a matrix?
Title: Re: LED Fader Code
Post by: spurgurgle on December 30, 2009, 03:21:27 PM
anyone try this on a matrix?
not yet.. but i imagine if you wanted to use this on a matrix using a swithching transistor would work the same as it does for all led mods....

or the same as it does for topps flasher code. i asked this question about the flasher and this was his responce

Use a transistor to power the PIC? Use the switched powersupply to release the mic supplys voltage?

Post Merge: November 30, 2009, 10:00:38 AM
heh sorry let me be more specific.

try this.

connect 'base' (B) of the transistor to any switched powersupply point on the controller (2v is fine) connect the fixed powersupply (mic) point to the 'collector' (C). Lastly.. connect the 'emitter' (E) to the PIC's VDD.

Should work fine
Title: Re: LED Fader Code
Post by: akomismo01 on December 30, 2009, 06:11:30 PM
Yes it can! Follow the wiring diagram (at the very top of this page) wire your leds, place them where you want! bam led fader in psp.

thank you!.. :victory:
Title: Re: LED Fader Code
Post by: t0pP8uZz on January 01, 2010, 01:06:01 PM
see i dont think this particular fader code will be able to work like the sickmods fader, due to the way the actual ROL works..... its done on some crazy PWM system im not to familar with it.

im currently avin a mess about with a rf module and this fader code and i cant get much to work..... i got the centre power light fading between red and blue when the console is on....  but nuthin like the sick mod chip..... also i think king mike is developing a fader chip for both pad and console check it out  https://www.acidmods.com/forum/index.php/topic,34206.0.html (https://www.acidmods.com/forum/index.php/topic,34206.0.html)

Umm can someone link me to a video/information on this sickmods chip?

Thanks!
Title: Re: LED Fader Code
Post by: aZiZ1 on January 01, 2010, 02:35:59 PM
http://diy.sickmods.net/Our_Products/SICKmods_Fader/About/ (http://diy.sickmods.net/Our_Products/SICKmods_Fader/About/)
Title: Re: LED Fader Code
Post by: t0pP8uZz on January 08, 2010, 04:48:09 AM
Thanks ill take a look
Title: Re: LED Fader Code
Post by: blackburn on January 10, 2010, 03:19:54 PM
no, the sickmods fader controls the GND for fading while t0p's uses VCC for fading

the RoL board has a Common Anode, and uses and PWM to control the LEDs by pulsing the GND
Title: Re: LED Fader Code
Post by: BIMPtacular on February 13, 2010, 09:33:05 AM
Hello, I just wanted to say that I love the hex. I installed a pic with your hex in my psp to get my mod started.  Here is a video of it doing it's thing. I used the slow hex with pin 7 powering the leds.

Psp fading shoulder buttons (http://www.youtube.com/watch?v=7lbmg2lylgw#normal)
Title: Re: LED Fader Code
Post by: t0pP8uZz on February 13, 2010, 02:39:26 PM
Really appriciate taking the time to post videos! Motivates me alot!

Do you mind if i put your video in the main post?

Also im working on a new customisable fader code.. its much more smoother and looks alot better.
Title: Re: LED Fader Code
Post by: BIMPtacular on February 13, 2010, 02:56:21 PM
Post away!  Once you get the new code up and running I would love to swap the hex on mine. Thanks for putting in the overtime. :#1:
Title: Re: LED Fader Code
Post by: t0pP8uZz on February 13, 2010, 04:04:25 PM
Yes the new code will be customisable.. Meaning YOU can choose the speed of the fade. you can choose the LED on time and off time! and you can define a duty cycle!

Heres a demo of a basic fade. As you can see its much smoother.

Dynamic LED Fader 1 (http://www.youtube.com/watch?v=bzhZvreqYbY#normal)

Title: Re: LED Fader Code
Post by: BIMPtacular on February 13, 2010, 04:45:29 PM
That is awesome. Are you writing a windows form to customize the hex?
Title: Re: LED Fader Code
Post by: t0pP8uZz on February 13, 2010, 08:53:13 PM
Yes, Just that exacly.

Basically im bytepatching the HEX from a Windows Based GUI program. (in C++)

I have alot in development so time is against me
Title: Re: LED Fader Code
Post by: BIMPtacular on February 14, 2010, 08:14:37 AM
If you need any help with basic functions of the program I'd be glad to help. I'm in school for game dev right now and I'm pretty good with c++.  Of course I'm not trying to say I would know how to bytepatch your hex, but I could help laying out the window and writing some save/load/open functions and such. Only if it would help you out.  Not trying to encroach on your project, just offering help. :winker:
Title: Re: LED Fader Code
Post by: t0pP8uZz on February 14, 2010, 08:49:51 AM
Yeah windows forms is a 2 minute job :-) Been developing in C++ for around 5 years so i should be okay, appriciate the offer though, ill be sure to let you know if i need anything!
Title: Re: LED Fader Code
Post by: BIMPtacular on February 14, 2010, 08:58:25 AM
Cool beans, yeah just offering. I do not have any lack of faith in your coding ability, at all. Thanks again for putting in the time to work on these great projects.
Title: Re: LED Fader Code
Post by: DDjusD on May 03, 2010, 02:07:55 AM
-snip-
Title: Re: LED Fader Code
Post by: GhoSt on May 03, 2010, 02:40:01 AM
use a switched power supply, such as the mike power. If you got matrix use a transistor to get a 3.6v switched.
Title: Re: LED Fader Code
Post by: DDjusD on May 03, 2010, 01:20:17 PM
-snip-
Title: Re: LED Fader Code
Post by: FOOKz™ on May 03, 2010, 03:24:00 PM
Quote
I wouldnt actually use resistors unless your voltage is high.

Please use resistors people, it increases the life of the chip and the LEDs. I would use a 10 Ohm resistor at minimum to drop that extra voltage so that LED's diode doesn't have to commit suicide.
Title: Re: LED Fader Code
Post by: Beneath on August 09, 2010, 01:27:44 PM
I would consider myself a noob in modding but when i connect all the points, the controller just turns off and the microchip gets extreamly hot. I did get it to work a few times but its just weird. Im sure its somthing simple im missing?
Title: Re: LED Fader Code
Post by: Modded Matt on August 10, 2010, 04:06:31 AM
you have a short somewhere or wired to the chip completly wrong
Title: Re: LED Fader Code
Post by: Beneath on August 10, 2010, 12:55:54 PM
you have a short somewhere or wired to the chip completly wrong

After looking at the wires, I had a short. Thanks Matt. Everything is working great.

Title: Re: LED Fader Code
Post by: Anonamous on August 23, 2010, 08:04:51 AM
dude, thats pure badass. Im gonna try this when i get around to doing my buttons with LED's :D
Title: Re: LED Fader Code
Post by: grizzlymodZ on October 01, 2011, 07:46:39 PM
this does NOT work for my CG controller..i have installed it correctly and everything :angry:
Title: Re: LED Fader Code
Post by: laxboy on October 02, 2011, 06:47:58 AM
The code is universal when it comes to controllers. it doesn't go off the controller all it needs is a forward voltage and a ground. What leds are you using?
Title: Re: LED Fader Code
Post by: Modded Matt on October 02, 2011, 08:23:31 AM
this does NOT work for my CG controller..i have installed it correctly and everything :angry:

post pics of your wiring.
Title: Re: LED Fader Code
Post by: grizzlymodZ on October 07, 2011, 12:44:03 PM
how?idk how 2 use this site that well
Title: Re: LED Fader Code
Post by: drummerdude on October 07, 2011, 01:03:32 PM
take a picture and upload it to a photo uploading site... i use photo bucket... then click the insert image button and put the link in there..
Title: Re: LED Fader Code
Post by: grizzlymodZ on October 22, 2011, 07:43:07 AM
for the leds on the controller i had 2 attach a 330ohm resistor on the VDD+ pin
Title: Re: LED Fader Code
Post by: skittles916 on December 12, 2011, 11:33:44 PM
Do you know where i can get the rar codes? I click on the link and Chrome says the site doesnt exits
Title: Re: LED Fader Code
Post by: Modded Matt on December 13, 2011, 05:05:39 AM
RAR is a compressed file, like a .zip file. you need the hex codes inside the RAR file. you will need a package manager to upzip the file. I use winzip.


here is a link to where all the files are archived.

https://www.acidmods.com/forum/index.php/topic,37478.0.html (https://www.acidmods.com/forum/index.php/topic,37478.0.html)
SimplePortal 2.3.5 © 2008-2012, SimplePortal