Conway's Game Of Life


Results 1 to 40 of 46

Threaded View

  1. #10


    Did you find this post helpful? Yes | No

    Default Re: Conway's Game Of Life NeoPixel

    Thread resurrection. Code help please.

    I'm working on this using a sequential 256 led neopixel string which is laid out in a prebuilt 16x16 matrix panel.

    The neopixel string works fine but is like a snakes and ladder board in that starting from bottom left corner you go along the bottom up at the end of the row then back along then up a row and along etc etc. (Back and forth)

    This arrangement is of course different to the actual LIFE array in PIC memory which is arranged as per the diagram.

    So I want to transfer data from the Life byte array into the NeoPixel byte array adjusting the NeoPixel(address) when necessary.

    The diagram might make it easier to see what i mean..

    Code:
    'Life Array 16x16 in memory.     'Life Array 16x16 Neopixel Matrix String.  
    
    '         Top                                  Top
    '240 -------------- 255             '255 -------------- 240
    '224 -------------- 239             '224 -------------- 239
    '208 -------------- 223             '223 -------------- 208
    '192 -------------- 207             '192 -------------- 207
    '176 -------------- 191             '191 -------------- 176
    '160 --x----------- 175             '160 --x----------- 175
    '144 ---x---------- 159             '159 ----------x--- 144
    '128 -xxx---------- 143             '128 -xxx---------- 143
    '112 -------------- 127             '127 -------------- 112
    '96  -------------- 111              '96  -------------- 111
    '80  -------------- 95               '95  -------------- 80
    '64  -------------- 79               '64  -------------- 79
    '48  -------------- 63               '63  -------------- 48
    '32  -------------- 47               '32  -------------- 47
    '16  -------------- 31               '31  -------------- 16
    '0   -------------- 15                '0   -------------- 15   
    '        Bottom                              Bottom
    Hopefully you see the problem, I can't see an efficient way to transfer the data from the LIFE to the NEOPIXEL array whilst correcting the address on the alternate lines..

    A simple Pixel(A) = Life(A) works for 0-15, 32-47 etc etc but not for 16-31, or 48-63 etc etc as the data ends up on the wrong part of the screen..

    Any brilliant ideas.

    You can see the problem on 144-159 with test data, it ends up on the wrong part of the screen.
    Last edited by retepsnikrep; - 15th May 2020 at 10:41.

Similar Threads

  1. programming jumping game
    By bokken in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th February 2012, 06:40
  2. Simon Game
    By flotulopex in forum Code Examples
    Replies: 1
    Last Post: - 4th November 2010, 06:25
  3. EEPROM life expectancy?
    By muddy0409 in forum General
    Replies: 3
    Last Post: - 1st May 2007, 12:44
  4. home brew game console W interface
    By PICMAN in forum General
    Replies: 1
    Last Post: - 15th March 2005, 22:25
  5. Game port to USB adaptor
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 24th September 2004, 03:16

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