Charlie-plexing


Closed Thread
Results 1 to 40 of 61

Thread: Charlie-plexing

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,694


    Did you find this post helpful? Yes | No

    Default Re: Charlie-plexing

    without a schematic its a bit difficult to intrepret whats going on in your code

    wired like this , i made a table on whats needed to light each led
    here is an example for a pic16f1825 to light each led in sequence


    Ps code in code tags is ten times easier to interpret
    Code:
    '****************************************************************
    '*  Name    : charlieplex.pbp                                        *
    '*  Author  : richard                                   *
    '*  Notice  :                                *
    '*          :                                *
    '*  Date    :                                          *
    '*  Version :    16f1825     @3.3 volts                               *
    '*  Notes   :       *
    '*          :              *
    '*            
    '****************************************************************
      
    #CONFIG
                 __config        _CONFIG1,    _FOSC_INTOSC & _CP_OFF & _WDTE_ON  &  _PWRTE_ON  &  _MCLRE_ON  & _CLKOUTEN_OFF
                  __config      _CONFIG2, _PLLEN_ON & _LVP_OFF
    #ENDCONFIG
    
    DEFINE OSC 32
     
         
    led var byte
    tmp var byte
     
    OSCCON=$70
    ANSELA=0
    ANSELC=0
    
    'TRISA = 0110
    'porta.0=1
    'pause 4000 
    'serout2 PORTA.0,84,[ "charlieplex",13,10]
       
    mainloop:
        
        for led=0 to 11
            lookup led,[12,12,9,9,3,3,5,5,6,6,10,10],tmp
            TRISC = $f0|tmp
            lookup led,[ 2, 1,4,2,8,4,8,2,8,1 ,4, 1],tmp
            latC = tmp
            pause 200
        next 
    goto mainloop
    Attached Images Attached Images  
    Last edited by richard; - 19th June 2016 at 11:27.
    Warning I'm not a teacher

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts