In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Rsadeika wrote: I guess I need an explanation as to the correct way of using an array which will be called as a bank. I set up 'genuse var byte (6)' which contains temp3, when I try to compile, it complains with an error of "ERROR 5 byte parameter expected 'temp3' ". Now I am not sure what the error is trying to tell me. Anybody have any ideas as it pertains to the program below? It is in the get_sircs SUB. Thanks Ray '=========================================================================== ' CR1.SXB ' DEVICE SX52,OSCHS2 FREQ 50_000_000 ''''''''' ' IO Pins ''''''''' rx1 pin re.0 input tx1 pin re.1 output IRpin pin re.7 input LED1 pin re.6 output ''''''''''' ' Constants ''''''''''' ''''''''''' ' Variables ''''''''''' 'x var byte 'This used in the TX1_Byte SUB 'could be general use temp1 var byte (4) 'This used in the TX1_Byte SUB, 'could be somewhere else? temp1W var word genuse var byte (6) x var genuse(0) temp2 var genuse(1) temp3 var genuse(2) temp4 var genuse(3) cmdCode var genuse(4) 'Used in the sircs routine devCode var genuse(5) 'RAM 262 bytes for data (variables) 'Global variables 17 bytes 'Variables in arrays 223 bytes '========== ' INTERRUPT '========== '============ PROGRAM Start '============ ''''''''''''''''''''''''' ' Subroutine Declarations ''''''''''''''''''''''''' TX1_Byte sub 1,4 get_ir_pulse sub 0 get_sircs sub 0 processIR sub 0 tempDB sub 0 '''''''''''''' ' Program Code '''''''''''''' Start: ' This initializes the Create and puts it into Safe mode TX1_Byte 128,131 'This will be the main loop Main: processIR goto Main 'The end of the code section end '''''''''''''''''''''''''''''' ' Subroutine and Function Code '''''''''''''''''''''''''''''' processIR: get_sircs if cmdCode = 16 then tempDB 'Ch+ if cmdCode = 17 then tempDB 'Ch- if cmdCode = 18 then tempDB 'Vol+ if cmdCode = 19 then tempDB 'Vol- if cmdCode = 21 then tempDB 'Power cmdCode = 0 return tempDB: high LED1 pause 2000 low LED1 return ' Use: TX1_Byte bytevalue or TX1_Byte bytevalue, bytevalue ... ' TX1_Byte: 'Fills the array with PARAM values temp1(0) = __PARAM1 temp1(1) = __PARAM2 temp1(2) = __PARAM3 temp1(3) = __PARAM4 temp2 = __PARAMCNT 'Get the PARAMCNT do while temp2 > 0 'Is the PARAMCNT greater than 0 serout tx1, T57600, temp1(x) dec temp2 'Reduce the PARAMCNT value by 1 inc x 'Will it increment the array to the next element loop return ''''''''''''''''' get_ir_pulse: bank genuse '<<<<<<<< pulsin IRpin, 0, temp4 return temp4 '======================== get_sircs: bank genuse '<<<<<<<< do temp2 = get_ir_pulse loop until temp2 > 216 cmdCode = 0 for temp3 = 0 to 6 '*****Compiler error****** cmdCode = cmdCode >> 1 temp2 = get_ir_pulse if temp2 > 108 then cmdCode.6 = 1 endif next devCode = 0 for temp3 = 0 to 4 devCode = devCode >> 1 temp2 = get_ir_pulse if temp2 > 108 then devCode.4 = 1 endif next bank 0 return ''''''''''' ' User Data ''''''''''' ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=202575 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)