May 05, 2024, 03:43:56 PM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Computer Matrix Board

Started by GregO, September 15, 2007, 02:46:38 PM

Previous topic - Next topic

GregO

Jon,
Once again you have come through for me, Thank you! The changing back and forth looks really cool on my test board.  Now to finish the 2 control boards for the Mouse.

Thank you again, I'll post pictures and stuff when completed.

I do have another question about the physical adjustment if necessary. 

If I needed to Charlieplex less than 30 leds (you mentioned that your test board was 15 leds) do I just eliminate from the longest string in this order D9, D10 then D17, D18 then ...?  What is the process to keep them balanced?

Thanks!
GregO

JonnyMac

Glad it all worked.

You don't need to keep things "balanced" -- they're just outputs (and you're not going to wear them out).  In order to keep the software the same, start by eliminating D30, then D29, etc.
Jon McPhalen
EFX-TEK Hollywood Office

GregO

Jon!
Panels are completed and delivered!  Thank you for your help!  The attached photo shows both left and right.  The left one is just "on"  12 leds attached to a power supply.  The right panel is more detailed with 30 "charlieplexed" leds running the combo program.  They look pretty darn good.  I delivered them last night to the stage company and they will age and install them. 

Duh Duh da da da duh duh!  Use the farce Luke!

Thanks again!

GregO

JonnyMac

Jon McPhalen
EFX-TEK Hollywood Office

GregO

Hey Jon!
I have a new question for programming the demo board I made for this.  I am using the program that has the random sequence and the cylon sequence in it, what would I have to add to the program to get a perpendicular cylon sequence.  The LED's are laid out in a 6 across by 5 down grid, from the back looking at them they are:

D1   D2  D3   D4   D5   D6
D7   D8  D9   D10 D11 D12
D13 D14 D15 D16 D17 D18
D19 D20 D21 D22 D23 D24
D25 D26 D27 D28 D29 D30

Perpendicular sequence would be in order D1,D7,D13,D19,D25, D26,D20,D14,D8,D2 and so on backwards and forwards.

Is there enough room to add?

Thanks!

GregO

JonnyMac

Give this a try:

' =========================================================================
'
'   File...... Cylon30_v2.BS1 (star wars panelnew)
'   Purpose... 30 LED Cyclon-type display via Charlieplexing
'   Author.... Jon Williams, EFX-TEK
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Modified.. Greg Owens
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Speed           = 7                     ' no ULN, remove SETUP
SYMBOL  Trigger         = PIN6                  ' SETUP = DN

SYMBOL  Leds            = PINS
SYMBOL  LedCtrl         = DIRS


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

SYMBOL  Pressed         = 1
SYMBOL  NotPressed      = 0


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

SYMBOL  theLed          = B2                    ' which LED is on
SYMBOL  pntr            = B3                    ' EEPROM pointer
SYMBOL  idx             = B4                    ' loop index
SYMBOL  addr            = B5                    ' eeprom address
SYMBOL  delay           = W5                    ' on-time for LED


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

Reset:
  Leds = %00000000                              ' clear LEDs
  LedCtrl = %00000000                           ' disable outputs


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

Main:
  FOR theLed = 1 TO 30
    GOSUB Set_Led
    GOSUB Speed_Delay
  NEXT

Hori_Backward:
  FOR theLed = 30 TO 1 STEP -1
    GOSUB Set_Led
    GOSUB Speed_Delay
  NEXT

Vert_Forward:
  FOR idx = 0 TO 29
    addr = $3C + idx
    READ addr, theLed
    GOSUB Set_Led
    GOSUB Speed_Delay
  NEXT

Vert_Backward:
  FOR idx = 29 TO 0 STEP -1
    addr = $3C + idx
    READ addr, theLed
    GOSUB Set_Led
    GOSUB Speed_Delay
  NEXT

  GOTO Main


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

' Pass LED to light (1 to 30) in "theLed"

Set_Led:
  IF theLed > 30 THEN Set_Led_Exit              ' bad LED #
    LedCtrl = %00000000                         ' disable LEDs
    pntr = theLed - 1 * 2                       ' point into table
    READ pntr, Leds                             ' get LED pins
    pntr = pntr + 1
    READ pntr, LedCtrl                          ' get control pins

Set_Led_Exit:
  RETURN

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

' Use Prop-Pot to control speed

Speed_Delay:
  POT Speed, 110, delay
  delay = delay * 4                             ' scale to ~1 sec max
  PAUSE delay
  RETURN

' -----[ EEPROM Data ]-----------------------------------------------------

Charlieplexed_Leds:

'            PINS       DIRS
'
  EEPROM (%00000001, %00000011)                 ' LED 1
  EEPROM (%00000010, %00000011)                 ' LED 2
  EEPROM (%00000001, %00000101)                 ' LED 3
  EEPROM (%00000100, %00000101)                 ' LED 4
  EEPROM (%00000001, %00001001)                 ' LED 5
  EEPROM (%00001000, %00001001)                 ' LED 6
  EEPROM (%00000001, %00010001)                 ' LED 7
  EEPROM (%00010000, %00010001)                 ' LED 8
  EEPROM (%00000001, %00100001)                 ' LED 9
  EEPROM (%00100000, %00100001)                 ' LED 10
  EEPROM (%00000010, %00000110)                 ' LED 11
  EEPROM (%00000100, %00000110)                 ' LED 12
  EEPROM (%00000010, %00001010)                 ' LED 13
  EEPROM (%00001000, %00001010)                 ' LED 14
  EEPROM (%00000010, %00010010)                 ' LED 15
  EEPROM (%00010000, %00010010)                 ' LED 16
  EEPROM (%00000010, %00100010)                 ' LED 17
  EEPROM (%00100000, %00100010)                 ' LED 18
  EEPROM (%00000100, %00001100)                 ' LED 19
  EEPROM (%00001000, %00001100)                 ' LED 20
  EEPROM (%00000100, %00010100)                 ' LED 21
  EEPROM (%00010000, %00010100)                 ' LED 22
  EEPROM (%00000100, %00100100)                 ' LED 23
  EEPROM (%00100000, %00100100)                 ' LED 24
  EEPROM (%00001000, %00011000)                 ' LED 25
  EEPROM (%00010000, %00011000)                 ' LED 26
  EEPROM (%00001000, %00101000)                 ' LED 27
  EEPROM (%00100000, %00101000)                 ' LED 28
  EEPROM (%00010000, %00110000)                 ' LED 29
  EEPROM (%00100000, %00110000)                 ' LED 30


Vert_Sequnce:
  EEPROM (1,  7, 13, 19, 25)                    ' start is at $3C
  EEPROM (2,  8, 14, 20, 26)
  EEPROM (3,  9, 15, 21, 27)
  EEPROM (4, 10, 16, 22, 28)
  EEPROM (5, 11, 17, 23, 29)
  EEPROM (6, 12, 18, 24, 30)
Jon McPhalen
EFX-TEK Hollywood Office