Shop
OBEX
P1 Docs
P2 Docs
Learn
Events
Large Lookup table — Parallax Forums
toggle menu
Categories
Discussions
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Sign In
·
Register
×
Home
›
General Discussion
Large Lookup table
DynamoBen
Posts:
366
2008-08-20 02:15
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-Fun
Posts:
388
2008-08-20 02:37
edited 2008-08-20 02:37
I expect lookup should work fine.
- Sparks
DynamoBen
Posts:
366
2008-08-20 02:54
edited 2008-08-20 02:54
The complier doesn't seem to "like" a lookup table that large.
PJMonty
Posts:
983
2008-08-20 03:34
edited 2008-08-20 03:34
DyamoBen,
Post the code so people can help you instead of guessing.
Thanks,
PeterM
Yendor
Posts:
288
2008-08-20 03:52
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.
JonnyMac
Posts:
9,215
2008-08-20 03:54
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 ....
DynamoBen
Posts:
366
2008-08-20 04:11
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.
Comments
- Sparks
Post the code so people can help you instead of guessing.
Thanks,
PeterM