In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Shawn Lowe wrote: Hello! Well, Im still working on my kegerator code, and after compiling my code and finding several rookie mistakes, the program finally compiles. However,it brings up the src program (I am not sure why) and displays a "symbol <__else1> is not defined. I am uncertain as to why it is saying this, as I have my SX_Key set up to work in SXB. Can anyone educate me? I would be thankful. ( I am using the BETA key, if that helps) Thanks [code]' ========================================================================= ' ' File...... ADC0831_Working_File.SXB ' Purpose... Tempurature controller for homebrew kegs ' Author.... ' E-mail.... ' Started... ' Updated... ' ' ========================================================================= ' ------------------------------------------------------------------------- ' Program Description ' ------------------------------------------------------------------------- ' ' Reads value from an ADC0831 ' Note that the SpeedMult feature is used with SHIFTIN to bump the clock ' speed up to ~332 kBits/sec (ADC0831 max is 400). [code]' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- [code]DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX FREQ 4_000_000 ID "beercool" [code]' ------------------------------------------------------------------------- ' IO Pins ' ------------------------------------------------------------------------- [code]Cpin PIN RA.2 OUTPUT ' shift clock Dpin PIN RA.1 INPUT ' shift data CS PIN RA.0 OUTPUT ' chip select [code]TX PIN RB.1 OUTPUT ' transmit to PC / Stampplot RC4 PIN RB.0 OUTPUT ' transmit to RC4 [code] ' ------------------------------------------------------------------------- ' Variables ' ------------------------------------------------------------------------- [code]temperature VAR Byte ' main variable tmpB1 VAR Byte ' working variables tmpB2 VAR Byte tmpW1 VAR Word [code]' ------------------------------------------------------------------------- ' Constants ' ------------------------------------------------------------------------- [code]IsOn CON 1 IsOff CON 0 App_Mod_On CON %1000 ' not currently used App_Mod_Off CON %0000 BaudMode CON "OT38400" [code]' ========================================================================= PROGRAM Start ' ========================================================================= [code]' ------------------------------------------------------------------------- ' Subroutine Declarations ' ------------------------------------------------------------------------- [code]DELAY_MS SUB 1, 2 ' delay in milliseconds TX_BYTE SUB 1 ' transmit a byte TX_STR SUB 2 ' transmit a string RESET_RC4 SUB 0 ' reset the RC-4 SET_RC4 SUB 1 ' set RC-4 relays Get_ADC SUB 0,1 ' get adc reading [code]' ------------------------------------------------------------------------- ' Program Code ' ------------------------------------------------------------------------- [code]Start: [code] DELAY_MS 250 ' let RC-4 power up RESET_RC4 [code] HIGH CS ' make CS output, no ADC LOW Cpin ' make clock 0-1-0 [code]Main: temperature = Get_ADC watch temperature [code] If temperature >= 38 then SET_RC4 %1000 If temperature <= 34 then SET_RC4 %0000 [code] DELAY_MS 250 BREAK [code]GOTO Main [code] [code] [code]' ------------------------------------------------------------------------- ' Subroutine Declarations ' ------------------------------------------------------------------------- [code]' Use: aVar = GET_ADC ' -- reads ADC0831 and places value into 'tmprtr' [code]FUNC Get_ADC CS = 0 ' activate ADC0831 SHIFTIN Dpin, Cpin, MSBPOST, tmpB1\1, 4 ' start conversion SHIFTIN Dpin, Cpin, MSBPOST, tmpB1, 4 ' shift in the data CS = 1 ' deactivate ADC0831 RETURN tmpB1 ENDFUNC [code]' ------------------------------------------------------------------------- [code]' Use: DELAY_MS duration ' -- replaces PAUSE [code] SUB DELAY_MS IF __PARAMCNT = 1 THEN tmpW1 = __PARAM1 ELSE tmpW1 = __WPARAM12 ENDIF PAUSE tmpW1 ENDSUB [code]' ------------------------------------------------------------------------- [code]' Use: TX_BYTE byteVal ' -- transmit "byteVal" at "BaudMode" on pin "Sio" [code]SUB TX_BYTE SEROUT RC4, BaudMode, __PARAM1 ENDSUB [code]' ------------------------------------------------------------------------- [code]' Use: TX_STR [string | label] ' -- "string" is an embedded string constant ' -- "label" is DATA statement label for stored z-String [code]SUB TX_STR tmpW1 = __WPARAM12 ' get address of string DO READINC tmpW1, tmpB1 ' read a character IF tmpB1 = 0 THEN EXIT ' if 0, string complete TX_BYTE tmpB1 ' send character LOOP ENDSUB [code]' ------------------------------------------------------------------------- [code]' Use: RESET_RC4 [code]SUB RESET_RC4 TX_STR "!!!!!!RC4" ' header (ensure sync) TX_BYTE %00 ' address TX_BYTE "X" ' reset command ENDSUB [code]' ------------------------------------------------------------------------- [code]' Use: SET_RC4 relayBits [code]SUB SET_RC4 tmpB2 = __PARAM1 ' get relay bits TX_STR "!RC4" ' header TX_BYTE %00 ' address TX_BYTE "S" ' set command TX_BYTE tmpB2 ' relay bits ENDSUB [code] [/code]P.s. I could not locate my file to upload. I can only find it using the SX_key. I think I saw this problem on another post? Any clues? ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=286376 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)