Shop OBEX P1 Docs P2 Docs Learn Events
"Expected a subroutine name" error — Parallax Forums

"Expected a subroutine name" error

Jim the HermitJim the Hermit Posts: 79
edited 2014-05-31 11:16 in General Discussion
I wrote a test program for my LCD and it used to work but, now I get an error in Debug_Lcd program


PUB init(pin, baud, lines) : okay

'' Initializes serial LCD object
'' -- returns true if all parameters okay
okay := lcd.init(pin, baud, lines)



What did I erase and how can I get it back?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-05-27 10:01
    Do you still declare the LCD object in an OBJ section of your program?

    -Phil
  • Jim the HermitJim the Hermit Posts: 79
    edited 2014-05-27 19:35
    I declared this in my program because that's what another program did. I'm still learning spin and not sure what Objects are.

    OBJ
    LCD : "debug_lcd"
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-05-27 19:37
    In that case, you should attach your entire program. There must be something else going on.

    -Phil
  • Jim the HermitJim the Hermit Posts: 79
    edited 2014-05-28 06:15
    None of my lcd programs work because they all apparently use Debug_Lcd. And init is highlighted in okay := lcd.init(pin, baud, lines)
    ''****************************************
    ''*  Debug_Lcd v1.2                      *
    ''*  Authors: Jon Williams, Jeff Martin  *
    ''*  Copyright (c) 2006 Parallax, Inc.   *
    ''*  See end of file for terms of use.   *
    ''****************************************
    ''
    '' Debugging wrapper for Serial_Lcd object
    ''
    '' v1.2 - March 26, 2008 - Updated by Jeff Martin to conform to Propeller object initialization standards.
    '' v1.1 - April 29, 2006 - Updated by Jon Williams for consistency.
    ''
    
    
    
    
    OBJ
    
    
      lcd : "serial_lcd"                                    ' driver for Parallax Serial LCD
      num : "simple_numbers"                                ' number to string conversion
    
    
    
    
    PUB init(pin, baud, lines) : okay
    
    
    '' Initializes serial LCD object
    '' -- returns true if all parameters okay
    
    
      okay := lcd.init(pin, baud, lines) 
    
    
    
    
    PUB finalize
    
    
    '' Finalizes lcd object -- frees the pin (floats)
    
    
      lcd.finalize
    
    
      
    PUB putc(txbyte)
    
    
    '' Send a byte to the terminal
    
    
      lcd.putc(txbyte)
      
      
    PUB str(strAddr)
    
    
    '' Print a zero-terminated string
    
    
      lcd.str(strAddr)
    
    
    
    
    PUB dec(value)
    
    
    '' Print a signed decimal number
    
    
      lcd.str(num.dec(value))  
    
    
    
    
    PUB decf(value, width) 
    
    
    '' Prints signed decimal value in space-padded, fixed-width field
    
    
      lcd.str(num.decf(value, width))   
      
    
    
    PUB decx(value, digits) 
    
    
    '' Prints zero-padded, signed-decimal string
    '' -- if value is negative, field width is digits+1
    
    
      lcd.str(num.decx(value, digits)) 
    
    
    
    
    PUB hex(value, digits)
    
    
    '' Print a hexadecimal number
    
    
      lcd.str(num.hex(value, digits))
    
    
    
    
    PUB ihex(value, digits)
    
    
    '' Print an indicated hexadecimal number
    
    
      lcd.str(num.ihex(value, digits))   
    
    
    
    
    PUB bin(value, digits)
    
    
    '' Print a binary number
    
    
      lcd.str(num.bin(value, digits))
    
    
    
    
    PUB ibin(value, digits)
    
    
    '' Print an indicated (%) binary number
    
    
      lcd.str(num.ibin(value, digits))     
        
    
    
    PUB cls
    
    
    '' Clears LCD and moves cursor to home (0, 0) position
    
    
      lcd.cls 
    
    
    
    
    PUB home
    
    
    '' Moves cursor to 0, 0
    
    
      lcd.home
      
    
    
    PUB gotoxy(col, line)
    
    
    '' Moves cursor to col/line
    
    
      lcd.gotoxy(col, line)
    
    
      
    PUB clrln(line)
    
    
    '' Clears line
    
    
      lcd.clrln(line)
    
    
    
    
    PUB cursor(type)
    
    
    '' Selects cursor type
    ''   0 : cursor off, blink off  
    ''   1 : cursor off, blink on   
    ''   2 : cursor on, blink off  
    ''   3 : cursor on, blink on
    
    
      lcd.cursor(type)
           
    
    
    PUB display(status)
    
    
    '' Controls display visibility; use display(false) to hide contents without clearing
    
    
      if status
        lcd.displayOn
      else
        lcd.displayOff
    
    
    
    
    PUB custom(char, chrDataAddr)
    
    
    '' Installs custom character map
    '' -- chrDataAddr is address of 8-byte character definition array
    
    
      lcd.custom(char, chrDataAddr)
    
    
          
    PUB backLight(status)
    
    
    '' Enable (true) or disable (false) LCD backlight
    '' -- affects only backlit models
    
    
      lcd.backLight(status)
    
    
    {{
    
    
    ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
    │                                                   TERMS OF USE: MIT License                                                  │                                                            
    ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
    │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation    │ 
    │files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,    │
    │modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│
    │is furnished to do so, subject to the following conditions:                                                                   │
    │                                                                                                                              │
    │The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│
    │                                                                                                                              │
    │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE          │
    │WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR         │
    │COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,   │
    │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                         │
    └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
    }}  
    
  • Dave HeinDave Hein Posts: 6,347
    edited 2014-05-28 07:06
    Did you change the name of the init method in serial_lcd.spin? That would cause the error that you are seeing.
  • PublisonPublison Posts: 12,366
    edited 2014-05-28 09:34
    Make sure you have not renamed Serial_LCD, Simple_Serial in the Propeller Library, or make sure they exist there.
  • Jim the HermitJim the Hermit Posts: 79
    edited 2014-05-28 13:35
    Dave Hein wrote: »
    Did you change the name of the init method in serial_lcd.spin? That would cause the error that you are seeing.

    If I did, I don't know how to unchange it.

    I have both Serial_Lcd and Simple_Serial. They both compile fine. I know at least one of my files is corrupted, how do I get new ones?
  • PublisonPublison Posts: 12,366
    edited 2014-05-28 14:06
    If I did, I don't know how to unchange it.

    I have both Serial_Lcd and Simple_Serial. They both compile fine. I know at least one of my files is corrupted, how do I get new ones?

    Serial_LCD, Simple_Serial, and Simple_Numbers are all in the Propeller Library. If they have gotten corrupted or removed, maybe just install the Propeller Tool again to refresh?

    FYI Your program in post #5 compiles and loads fine on a Quickstart Board with Propeller Tool Ver 3.1.2
  • Jim the HermitJim the Hermit Posts: 79
    edited 2014-05-28 18:59
    Publison wrote: »
    Serial_LCD, Simple_Serial, and Simple_Numbers are all in the Propeller Library. If they have gotten corrupted or removed, maybe just install the Propeller Tool again to refresh?

    FYI Your program in post #5 compiles and loads fine on a Quickstart Board with Propeller Tool Ver 3.1.2

    Do you have a link?
  • PublisonPublison Posts: 12,366
    edited 2014-05-29 02:58
    "library" is a folder in the Prop Tool.

    Library.jpg
    257 x 761 - 122K
  • Jim the HermitJim the Hermit Posts: 79
    edited 2014-05-29 09:51
    I meant a link for Propeller Tool. It's not in obex or in the quickstart purchase page or show up in search window
  • PublisonPublison Posts: 12,366
    edited 2014-05-29 09:59
    I meant a link for Propeller Tool. It's not in obex or in the quickstart purchase page or show up in search window

    Sorry Jim

    http://www.parallax.com/downloads/propeller-tool-software
  • Dave HeinDave Hein Posts: 6,347
    edited 2014-05-29 10:23
    This would be a whole lot easier to debug if you could just provide a screenshot showing the error. We're all just guessing about what the problem might be, but without more information we're just guessing. It appears that you may have inadvertently changed a source file for an object in the library, but like I said, it's just a guess.
  • Jim the HermitJim the Hermit Posts: 79
    edited 2014-05-31 11:16
    After I tried repairing and modifying it, I uninstalled Prop tools (then deleted the rest by hand) and reinstalled it- it fixed the bug. My Lcd doesn't work, but it's a different problem I gotta troubleshoot.

    Thanks for the help
Sign In or Register to comment.