Author Topic: LED Fader Code  (Read 26722 times)

Offline t0pP8uZz

  • Granny Spanker
  • *
  • Posts: 477
  • Post quality +4/-0
  • Gender: Male
  • Programmer / Security Expert
    • http://milw0rm.com/author/1141
LED Fader Code
« 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:


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
[spoiler]Fast Fade:          http://t0pp8uzz.com/files/FADER.rar
Slow Fade:        http://t0pp8uzz.com/files/FADERSlow.rar
Very Slow Fade:      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

Red and Yellow Fade Change:(submitted by spurgurgle)
fader dome RY.MOV

Green and Blue Fade Change: (submitted by spurgurgle)
fader dome GB.MOV

PSP Shoulder Buttons (submitted by BIMPtactular)
Psp fading shoulder buttons

Installs:
Spurgurgle's Xbox 360 ROL Fader Install: https://www.acidmods.com/forum/index.php/topic,34129.msg257520.html#new
« Last Edit: December 20, 2013, 06:50:42 PM by GhoSt »

Offline spurgurgle

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1121
  • Post quality +17/-1
  • Gender: Male
  • call me spurg
    • my blog
Re: LED Fader Code
« Reply #1 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?????????
« Last Edit: November 22, 2009, 07:19:02 AM by spurgurgle »

Sigs made by Ken and blazin from the AM Art team cheers guys.....
Spurgurgle d.t com
"I'm kinda like a typo, not quite right, but most people still understand me"

Offline t0pP8uZz

  • Granny Spanker
  • *
  • Posts: 477
  • Post quality +4/-0
  • Gender: Male
  • Programmer / Security Expert
    • http://milw0rm.com/author/1141
Re: LED Fader Code
« Reply #2 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 :-)

Offline spurgurgle

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1121
  • Post quality +17/-1
  • Gender: Male
  • call me spurg
    • my blog
Re: LED Fader Code
« Reply #3 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.....


Sigs made by Ken and blazin from the AM Art team cheers guys.....
Spurgurgle d.t com
"I'm kinda like a typo, not quite right, but most people still understand me"

Offline t0pP8uZz

  • Granny Spanker
  • *
  • Posts: 477
  • Post quality +4/-0
  • Gender: Male
  • Programmer / Security Expert
    • http://milw0rm.com/author/1141
Re: LED Fader Code
« Reply #4 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

Offline GhoSt

  • Creating Null
  • Around the block
  • *
  • Posts: 2552
  • Post quality +19/-0
  • Gender: Male
  • Null Pointer Exception
Re: LED Fader Code
« Reply #5 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.
« Last Edit: November 22, 2009, 08:55:31 PM by GhoSt_Death »
|Variegation - GhoSt's Final Controller|

|Nothing is deterministic.|

Offline t0pP8uZz

  • Granny Spanker
  • *
  • Posts: 477
  • Post quality +4/-0
  • Gender: Male
  • Programmer / Security Expert
    • http://milw0rm.com/author/1141
Re: LED Fader Code
« Reply #6 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

Offline laxboy

  • i like airplanes
  • Acidmods Alumni
  • E = MC² Mad Scientist
  • *
  • Posts: 1627
  • Post quality +12/-0
  • Gender: Male
  • CTVFD 9/11 lost but never forgotten
Re: LED Fader Code
« Reply #7 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

Offline Jumbo

  • Dr. Mod
  • BST BAN
  • Around the block
  • *
  • Posts: 2399
  • Post quality +0/-3
Re: LED Fader Code
« Reply #8 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

Offline GhoSt

  • Creating Null
  • Around the block
  • *
  • Posts: 2552
  • Post quality +19/-0
  • Gender: Male
  • Null Pointer Exception
Re: LED Fader Code
« Reply #9 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.
|Variegation - GhoSt's Final Controller|

|Nothing is deterministic.|

Offline t0pP8uZz

  • Granny Spanker
  • *
  • Posts: 477
  • Post quality +4/-0
  • Gender: Male
  • Programmer / Security Expert
    • http://milw0rm.com/author/1141
Re: LED Fader Code
« Reply #10 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.

Offline GhoSt

  • Creating Null
  • Around the block
  • *
  • Posts: 2552
  • Post quality +19/-0
  • Gender: Male
  • Null Pointer Exception
Re: LED Fader Code
« Reply #11 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.
|Variegation - GhoSt's Final Controller|

|Nothing is deterministic.|

Offline t0pP8uZz

  • Granny Spanker
  • *
  • Posts: 477
  • Post quality +4/-0
  • Gender: Male
  • Programmer / Security Expert
    • http://milw0rm.com/author/1141
Re: LED Fader Code
« Reply #12 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
Slow Fade:        http://t0pp8uzz.com/files/FADERSlow.rar
Very Slow Fade:      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.

Offline GhoSt

  • Creating Null
  • Around the block
  • *
  • Posts: 2552
  • Post quality +19/-0
  • Gender: Male
  • Null Pointer Exception
Re: LED Fader Code
« Reply #13 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)
« Last Edit: November 25, 2009, 11:47:22 AM by GhoSt_Death »
|Variegation - GhoSt's Final Controller|

|Nothing is deterministic.|

Offline t0pP8uZz

  • Granny Spanker
  • *
  • Posts: 477
  • Post quality +4/-0
  • Gender: Male
  • Programmer / Security Expert
    • http://milw0rm.com/author/1141
Re: LED Fader Code
« Reply #14 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

Offline spurgurgle

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1121
  • Post quality +17/-1
  • Gender: Male
  • call me spurg
    • my blog
Re: LED Fader Code
« Reply #15 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

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


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

Red and Yellow
fader dome RY

Green and Blue
fader dome GB


« Last Edit: December 22, 2009, 10:33:10 AM by spurgurgle »

Sigs made by Ken and blazin from the AM Art team cheers guys.....
Spurgurgle d.t com
"I'm kinda like a typo, not quite right, but most people still understand me"

Offline t0pP8uZz

  • Granny Spanker
  • *
  • Posts: 477
  • Post quality +4/-0
  • Gender: Male
  • Programmer / Security Expert
    • http://milw0rm.com/author/1141
Re: LED Fader Code
« Reply #16 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

Offline spurgurgle

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1121
  • Post quality +17/-1
  • Gender: Male
  • call me spurg
    • my blog
Re: LED Fader Code
« Reply #17 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.


« Last Edit: December 22, 2009, 10:52:07 AM by spurgurgle »

Sigs made by Ken and blazin from the AM Art team cheers guys.....
Spurgurgle d.t com
"I'm kinda like a typo, not quite right, but most people still understand me"

Offline t0pP8uZz

  • Granny Spanker
  • *
  • Posts: 477
  • Post quality +4/-0
  • Gender: Male
  • Programmer / Security Expert
    • http://milw0rm.com/author/1141
Re: LED Fader Code
« Reply #18 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

Offline spurgurgle

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1121
  • Post quality +17/-1
  • Gender: Male
  • call me spurg
    • my blog
Re: LED Fader Code
« Reply #19 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:

Sigs made by Ken and blazin from the AM Art team cheers guys.....
Spurgurgle d.t com
"I'm kinda like a typo, not quite right, but most people still understand me"

Offline spurgurgle

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1121
  • Post quality +17/-1
  • Gender: Male
  • call me spurg
    • my blog
Re: LED Fader Code
« Reply #20 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


and this is what im doing with it in the console.
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.
« Last Edit: December 28, 2009, 12:34:28 PM by spurgurgle »

Sigs made by Ken and blazin from the AM Art team cheers guys.....
Spurgurgle d.t com
"I'm kinda like a typo, not quite right, but most people still understand me"

Offline SPARCT

  • MFH
  • Chief squatting Hard
  • *
  • Posts: 17
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: LED Fader Code
« Reply #21 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.

Offline spurgurgle

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1121
  • Post quality +17/-1
  • Gender: Male
  • call me spurg
    • my blog
Re: LED Fader Code
« Reply #22 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.

Sigs made by Ken and blazin from the AM Art team cheers guys.....
Spurgurgle d.t com
"I'm kinda like a typo, not quite right, but most people still understand me"

Offline t0pP8uZz

  • Granny Spanker
  • *
  • Posts: 477
  • Post quality +4/-0
  • Gender: Male
  • Programmer / Security Expert
    • http://milw0rm.com/author/1141
Re: LED Fader Code
« Reply #23 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


and this is what im doing with it in the console.
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

Offline SPARCT

  • MFH
  • Chief squatting Hard
  • *
  • Posts: 17
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: LED Fader Code
« Reply #24 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

Offline spurgurgle

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1121
  • Post quality +17/-1
  • Gender: Male
  • call me spurg
    • my blog
Re: LED Fader Code
« Reply #25 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

Sigs made by Ken and blazin from the AM Art team cheers guys.....
Spurgurgle d.t com
"I'm kinda like a typo, not quite right, but most people still understand me"

Offline akomismo01

  • Ω Allumnist Ω
  • *
  • Posts: 142
  • Post quality +0/-0
  • Gender: Male
  • prOudLy PiNoy!..
Re: LED Fader Code
« Reply #26 on: December 30, 2009, 09:26:31 AM »
sorry to interupt but can this be used on a psp?

Boooh Yah!

Offline gamerdude767

  • Blogs & Media Member
  • Acid Modder
  • *
  • Posts: 634
  • Post quality +1/-0
  • Gender: Male
Re: LED Fader Code
« Reply #27 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.

Quote from: H-Sauce
**Long Pause**........
Yup, thats better than balloons

Offline spurgurgle

  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1121
  • Post quality +17/-1
  • Gender: Male
  • call me spurg
    • my blog
Re: LED Fader Code
« Reply #28 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.
« Last Edit: December 30, 2009, 03:11:41 PM by GhoSt_Death »

Sigs made by Ken and blazin from the AM Art team cheers guys.....
Spurgurgle d.t com
"I'm kinda like a typo, not quite right, but most people still understand me"

Offline SN!P3R

  • Millennium Poster
  • *
  • Posts: 1444
  • Post quality +0/-10
  • Gender: Male
Re: LED Fader Code
« Reply #29 on: December 30, 2009, 01:41:36 PM »
anyone try this on a matrix?
BEST 360 MODDING
HELP OUR ECONOMY!

360 MASHUP THREAD

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.5 © 2008-2012, SimplePortal