Shop OBEX P1 Docs P2 Docs Learn Events
Large Lookup table — Parallax Forums

Large Lookup table

DynamoBenDynamoBen Posts: 366
edited 2008-08-20 04:11 in General Discussion
I'm doing a conversion on some incoming serial data. Typically I would use a lookup table but·I am using·255 values. Is lookup going to work or should I go about this another way?

Comments

  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2008-08-20 02:37
    I expect lookup should work fine.


    - Sparks
  • DynamoBenDynamoBen Posts: 366
    edited 2008-08-20 02:54
    The complier doesn't seem to "like" a lookup table that large.
  • PJMontyPJMonty Posts: 983
    edited 2008-08-20 03:34
    DyamoBen,

    Post the code so people can help you instead of guessing.

    Thanks,
    PeterM
  • YendorYendor Posts: 288
    edited 2008-08-20 03:52
    Try putting your data in a table and use 'read'. Check out 'read' in the SX/B help file.
  • JonnyMacJonnyMac Posts: 9,215
    edited 2008-08-20 03:54
    If you're using SX/B you can use the incoming value as an index into a data table that you access with READ -- like this:

    idx = RX_BYTE
    READ MyTable+idx, outByte
    
    ....
    
    MyTable:
      DATA  000, 001, 002, 003, 004 ....
    
  • DynamoBenDynamoBen Posts: 366
    edited 2008-08-20 04:11
    I was considering making a DATA table, I will play around with that and see how it works. Thanks.
Sign In or Register to comment.