filling an array


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Posts
    10

    Default filling an array

    I'm trying to place images on a 128*64 display.

    the output of my picture converter looks like (yes these are empty):

    00, 00, 00, 00, 00, 00, 00, 00
    00, 00, 00, 00, 00, 00, 00, 00
    00, 00, 00, 00, 00, 00, 00, 00

    is there a way i can place those directly into an array (p) like this?

    Code:
    p1=[00, 00, 00, 00, 00, 00, 00, 00]
    p2=[00, 00, 00, 00, 00, 00, 00, 00]
    Thanks in advance. I'm using Microcode Studio as editor.

  2. #2
    Join Date
    Aug 2010
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    I also found a CDATA command, but unfortunately i cannot use this in PicbasicPro?

    Is it possible to use the lookup command to fill arrays?

    Thanks in advance.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Welcome to the forum.

    Yes a lookup table can be used. The best I can do at the moment is point you to an example that has a string and comma seperated values being put into an arrary.
    http://www.picbasic.co.uk/forum/cont...ns-for-Dummies!

    But how do you plan on building the table with data?
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Aug 2010
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    I'm currently using a FOR loop to build the data.
    Just checking the byte position, and then switching lines and left/right.

    Code:
    logopart1:
    for logo = 0 to 255
    lookup logo, [255,255,255,10,10, etc] ,L
    next
    gosub placeandcontroldata
    return
    This works, but I cannot easily import pictures into the code this way...

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    This works, but I cannot easily import pictures into the code this way...
    I guess I do not understand exactly what you are trying to do.
    Is the picture being sent to the MCU via serial? Or are you hard coding it. or something else?
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Aug 2010
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    I'm making the pictures with a program like Bitmap2LCD, which comes into an .h file.
    I try to import these pictures into my code (copy-paste), and then putting them on the screen of an 128*64 LCD through a databyte. But I cannot get the whole 1024 bytes on the screen with 1 command.

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