18x and 56 LED's

jmumby

Senior Member
Thanks to hippys discovery that tickling an 18x can make the outputs inputs http://www.picaxeforum.co.uk/showthread.php?t=5827&highlight=18x+bi-directional it's is conceivable to control 56 LED's (charlieplex).

I only want to control about 20 so this works for me if I want to have individual LED's on. But Im trying to make a cylon/kitt chaser and want the fade effect on the trailing LED's. At the moment I have sub routines for each led for example

Code:
GOSUB LED1
PAUSE 200
GOSUB LED2
PAUSE 200
GOSUB LED3  
PAUS..............

LED1:
POKE $AE,%00000001
HIGH A1
LOW A2
RETURN

LED2:
POKE $AE........
Anyhue got it working perfect for six LED's bar the fading bit, anyone have any suggestions how/if this fading could be achieved?

Cheers
 

hippy

Senior Member
any suggestions how/if this fading could be achieved?
Perhaps decrease the amount of time the LED's which need dimming are on for. Balance that against an increased pause after so the overall intensity doesn't drift about ...
Code:
Same           LED2 dimmer than LED1

Pause 200      Pause 200
Gosub LED1     Gosub LED1
Pause 200      Pause 50
Gosub LED2     Gosub LED2
Pause 200      Pause 350
Or something along those lines.
 

jmumby

Senior Member
The thing is to have both LED's on at the same time. So I have played around with it a bit and I can get two say 1 and 6 on using the table below

Code:
IO1 IO2 IO3  1 2 3 4 5 6
 0   0   0   0 0 0 0 0 0
 0   1   I   1 0 0 0 0 0
 1   0   I   0 1 0 0 0 0
 I   0   1   0 0 1 0 0 0
 I   1   0   0 0 0 1 0 0
 0   I   1   0 0 0 0 1 0
 1   I   0   0 0 0 0 0 1
So I pulsout LED1 and have LED6 on and I get LED half brightness on LED1 so I would organise LED1 to sit next to LED6 for the effect. But I don't think I have enough combinations for 6 LEDS and possibly I could do this with 4 IO's and 12 LED's which was the goal anyway but I can't quite get my head around the combinations anyone have a table for 4 IO's?

Thanks.
 
Last edited:
Top