Shop OBEX P1 Docs P2 Docs Learn Events
WDATA / DATA statement bit shifting — Parallax Forums

WDATA / DATA statement bit shifting

T&E EngineerT&E Engineer Posts: 1,396
edited 2007-03-21 00:22 in General Discussion
Does anyone know of a good way to·move or shift·data in WDATA statements arround?

For example if I had the following:

WDATA %11111111_00000000
WDATA %11111111_00000000
WDATA %11000000_00000000
WDATA %11000000_00000000
WDATA %11000000_00000000
WDATA %11000000_00000000
WDATA %11000000_00000000
WDATA %11000000_00000000
WDATA %11000000_00000000
WDATA %11000000_00000000
WDATA %11000000_00000000
WDATA %11000000_00000000
WDATA %11000000_00000000
WDATA %11000000_00000000
WDATA %11111111_00000000
WDATA %11111111_00000000

so that it looks more like the data was shifted 90 degrees or something like this?

WDATA %11111111_11111111
WDATA %11111111_11111111
WDATA %11000000_00000011
WDATA %11000000_00000011
WDATA %11000000_00000011
WDATA %11000000_00000011
WDATA %11000000_00000011
WDATA %11000000_00000011
WDATA %11000000_00000011
WDATA %00000000_00000000
WDATA %00000000_00000000
WDATA %00000000_00000000
WDATA %00000000_00000000
WDATA %00000000_00000000
WDATA %00000000_00000000
WDATA %00000000_00000000
WDATA %00000000_00000000

Not that I actually want new WDATA statements but yet it was stored in an array or something from a READINC or READ command.

I was thinking of the << or >> commands but then the data would be lost if shifted off the end.

I just don't want to re-invent the wheel if this has already been done or an easy method to do this can be done.

Any help here would be appreciated.

Post Edited (T&E Engineer) : 3/19/2007 9:51:18 PM GMT

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-03-20 23:14
    I "see" what you want to do, but I can't figure why you don't just re-wire your hardware to make it happen.· I guess that you already have a lot of DATA programmed and you just want to re-arrange it.· But, what's really going on here?· Obviously, this has something to do with your current project -- http://forums.parallax.com/showthread.php?p=636887
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-21 00:22
    Yes thats correct. I was going too far beyond the scope of my original question of the SX28 and SX52 so I thought I should open a new posting.

    I can currently scroll LEFT and UP using a technique from the Parallax RobOylmpic coding - on my 16x16 LED display. I can also make this code scroll on either the left or right side (16x8 leds) OR top or bottom side (8x16 leds).

    Scrolling from the right to the left looks good but scrolling up shows the letters in the·same direction and mirrored or flipped. I thought each letter should face upwards if scrolling up. This means I can add an additional set of data statements for all of the letters meaning I would have to had fixed each letter DATA statment manually (e.g. rotate 90 degrees is what I mean) - OR I can use the same DATA statements I have for scrolling LEFT and just do some math on each letter before it gets displayed.

    Here is my· latest code if you want to give it a look.
Sign In or Register to comment.