Searching \ for '[SX] Constant Array SX/B' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/ubicom/languages.htm?key=sx
Search entire site for: 'Constant Array SX/B'.

Exact match. Not showing close matches.
PICList Thread
'[SX] Constant Array SX/B'
2005\10\30@144725 by vinchin/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, vinchi wrote:

Hello!

I dont know hove to make an constant array in SX/B? Something dont work. I am only strating with SX.


DEVICE          SX52, OSC4MHZ
', TURBO, STACKX, OPTIONX
FREQ            4_000_000
' =========================================================================
 PROGRAM Start
' =========================================================================
counter VAR byte
LED VAR RD
MASIVS VAR BYTE(8)
MASIVS(0) = %00000001
MASIVS(1) = %00000010
MASIVS(2) = %00000100
MASIVS(3) = %00001000
MASIVS(4) = %00010000
MASIVS(5) = %00100000
MASIVS(6) = %01000000
MASIVS(7) = %10000000
       
Start:
TRIS_A = %00000000
TRIS_B = %00000000
TRIS_C = %00000000
TRIS_D = %00000000
TRIS_E = %00000000
Main:
FOR counter = 0 TO 7
 LED = MASIVS(counter)
 PAUSE 1
NEXT
GOTO START

Is it possible to make constant array like in C?

const char test[] = {  
11111111b,
11111110b,
11111110b,
00000000b,
00000000b,
11111110b,
11111110b,
11111111b,
00000000b};
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=93983
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)

2005\10\30@145326 by beann/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote:

I would do it as a LOOKUP table.

LOOKUP counter,%00000001,%00000010,%00000100,%00001000,%00010000,%00100000,%01000000,%10000000,LED
For larger tables use DATA and READ
Bean.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=93983#m93985
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)

2005\10\30@145725 by vinchin/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, vinchi wrote:

THX! Good idea. But can you tel me what is wrong whit my script. Why i cant get the array variable to the port?

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=93983#m93986
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)

2005\10\30@153146 by beann/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote:

Vinchi,
 Since there are no constant arrays in SX/B, you must move your assignments inside the execute path.
 For example:

DEVICE          SX52, OSC4MHZ
', TURBO, STACKX, OPTIONX
FREQ            4_000_000
' =========================================================================
 PROGRAM Start
' =========================================================================
counter VAR byte
LED VAR RD
MASIVS VAR BYTE(8)
Start:

MASIVS(0) = %00000001
MASIVS(1) = %00000010
MASIVS(2) = %00000100
MASIVS(3) = %00001000
MASIVS(4) = %00010000
MASIVS(5) = %00100000
MASIVS(6) = %01000000
MASIVS(7) = %10000000
TRIS_A = %00000000
TRIS_B = %00000000
TRIS_C = %00000000
TRIS_D = %00000000
TRIS_E = %00000000
Main:
FOR counter = 0 TO 7
 LED = MASIVS(counter)
 PAUSE 1
NEXT
GOTO Main
Bean.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=93983#m93988
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...