November 15, 2024, 03:52:24 AM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


LED fading & Charlieplexing

Started by Clad In Shadows, August 03, 2009, 06:51:54 PM

Previous topic - Next topic

Clad In Shadows

Is it possible to use this fading LED program combined with the charlieplexing schematic?
The purpose is to have all 30 LEDs come on and fade out in sequence ( 1-->30) .

Here's the code used for the fading LEDs.

' =========================================================================
'
'   File......
'   Purpose...
'   Author.... Jon Williams, EFX-TEK
'              Copyright (c) 2009 EFX-TEK
'              Some Rights Reserved
'              -- see http://creativecommons.org/licenses/by/3.0/
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated... 19 JUL 2009
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'

' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------


' -----[ Constants ]-------------------------------------------------------

SYMBOL  IsOn            = 1                     ' for active-high in/out
SYMBOL  IsOff           = 0

SYMBOL  Yes             = 1
SYMBOL  No              = 0


' -----[ Variables ]-------------------------------------------------------

SYMBOL  pin             = B2
SYMBOL  level           = B3


' -----[ Initialization ]--------------------------------------------------

Reset:


' -----[ Program Code ]----------------------------------------------------

Main:
  FOR pin = 0 TO 7                              ' loop through all pins
    HIGH pin                                    ' turn on
    PAUSE 250                                   ' short delay
    FOR level = 255 TO 0 STEP -1                ' fade out
      PWM pin, level, 2                         ' modulate the pin
    NEXT
  NEXT
  GOTO Main


' -----[ Subroutines ]-----------------------------------------------------


' -------------------------------------------------------------------------


' -----[ User Data ]-------------------------------------------------------

JonnyMac

August 03, 2009, 07:35:46 PM #1 Last Edit: August 03, 2009, 07:38:58 PM by JonnyMac
I really don't think so, but let me think about it for a while.  Charlieplexing is really hard stuff and I'm sorry I ever raised that topic in these forums.
Jon McPhalen
EFX-TEK Hollywood Office

Clad In Shadows

What would life be without a challenge huh?
It sure got me wondering , not to mention confused.

JonnyMac

Charlie-plexing is a nightmare, even with a high speed processor like the SX; there is no way you're going to use the Prop-1 to control fading of 30 LEDs.  Even with the SX it would be a nightmare and not worth doing.  I just worked with a mouse-ridden amusement park to help them with some SX code for a custom prop that controls 16 LEDs (it's an SX28).  I would suggest that selective fading of 30 LEDs is going to require and SX48 and four ULN2803s to handle the current.

If you could live with 28 LEDs then the Propeller chip from Parallax is another option, and gives you more horsepower in an easier-to-program package.

Sorry that I don't have the news you're hoping for.  As my friends in the DPRG (Dallas Personal Robotics Group) remind us, sometimes... "It's harder than it looks."
Jon McPhalen
EFX-TEK Hollywood Office

Clad In Shadows

No reason to be sorry. I was just wondering if it was possible.
Thank you for looking into it , Jon.
All is good. And we're moving on. ;)