Menu

What's up with LCDWord?

Help
2007-02-09
2013-05-30
  • Sterling Youngman

    this is truncated, but the basic program is:

    1. DIM sensor AS word

    2. sensor = 1345

    3. LCDWord (sensor)

    and on the LCD I get "0065"

    if I modify "2" line to 'sensor = 1345 [WORD]' then the LCD displays 40001

    what am I doing wrong?

    -Sterling

     
    • Hugh Considine

      Hugh Considine - 2007-02-10

      You're not doing anything wrong - GCBASIC is. I can't reproduce the bug myself with the newest version of GCBASIC and a 16F877A or 18F4550, so download http://gcbasic.sourceforge.net/newfiles/update.zip and see if it goes away.

       
    • Sterling Youngman

      Problem still there. Here is the entire program:

      ---------------------
      #chip 16F684, 20
      '#config _CP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC
      #mem 128

      DIM potSensor as WORD

      #define LCD_IO 4
      #define LCD_DB4 PORTC.0
      #define LCD_DB5 PORTC.1
      #define LCD_DB6 PORTC.2
      #define LCD_DB7 PORTC.3
      #define LCD_RS PORTC.4
      #define LCD_RW PORTA.0
      #define LCD_Enable PORTC.5

      ADoff

      Main:
      'initLCD
      DIR PORTA.1 IN

      wait 1 sec
      Print "HELLO WORLD??"

      Locate 1,0

      potSensor = 1345

      LCDWord (potSensor)

      wait 50 10ms

      cls

      Goto Main

      -------------------

      I'll try a different PIC later.

      -Sterling

       
    • Sterling Youngman

      I tried another PIC 16F648A, and gett the same LCDWord output as with the other PIC.

      -Sterling

       
    • Hugh Considine

      Hugh Considine - 2007-02-10

      I think I may have fixed the bug. The updated gcbasic.exe file is in http://gcbasic.sourceforge.net/newfiles/gcbasicexe.zip

       
    • Sterling Youngman

      That fixed it. Many thanks!

      -Sterling

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.