2D Matrix Rotation


Results 1 to 9 of 9

Threaded View

  1. #2
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    off the top of my head this is what i came up with (untested):

    Code:
    array          var byte[8]
    array_rotated  var byte[8]
    bit_num        var byte
    byte_num       var byte
    temp           var byte
    result         var byte
    
    for byte_num=0 to 7
        for bit_num=0 to 7
            temp=array[7-bit_num]
            temp=temp>>byte_num
            result=result<<1
            result.0=temp.0
        next bit_num
        array_rotated[byte_num]=result
    next byte_num
    *edit* fixed some mistakes
    *edit* fixed one last mistake
    Last edited by Kamikaze47; - 15th February 2010 at 07:05.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

Similar Threads

  1. led matrix pic 16f84 and 4017 help me please
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 5th February 2011, 00:06
  2. RGB LED Matrix
    By ERIK in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 28th June 2008, 07:01
  3. LED Matrix Question
    By mekohler in forum Schematics
    Replies: 28
    Last Post: - 29th September 2007, 13:12
  4. 4x16 Dot Matrix LCD control is possible?
    By muskut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st September 2005, 09:56
  5. need help with switch matrix
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 26th January 2005, 18:59

Members who have read this thread : 0

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