Thanks,
Here is the Zip's
I needed to put parantheses on the (#) as the text otherwise would become very large in here!
I'm aware of the missing semi-colon, my fault during edit, sorry!
2) Copy encoder.h to the greatcowbasic/include folder
3) Use < > instead of quotes to include encoder.h in the main program
4) Do not include LCD.H in the program. Any library that is in the lowlevel folder and listed in the /include/lowlevel.dat file is automatically included.
5) correct formatting error in program
When I did the above, the program below compiles without error.
Hi Guys,
Still new to GCB, so I need a Little help.
Following program returns a compiler error:
"Error in library lcd.h: Invalide variable type: LONG"
This error is written four times!
Maybe I need to change in the lcd.h file, but I'm not sure what to change
;Chip Settings
(#)chip 16F886,8
(#)config DEBUG=OFF, LVP=OFF, FCMEN=OFF, IESO=OFF, BOR=OFF, CPD=OFF, CP=OFF, MCLRE=OFF, PWRTE=OFF, WDT=OFF, OSC=INTRC_OSC_NOCLKOUT, WRT=OFF
;Include files (Libraries)
(#)include "encoder.h"
(#)include "lcd.h"
;Defines (Constants)
(#)define LCD_IO 4
(#)define LCD_RS PortB.0 ;LCD Register Select on pin 8
(#)define LCD_Enable PortB.1 ;LCD Enable on pin 9
(#)define LCD_DB4 PortB.2
(#)define LCD_DB5 PortB.3
(#)define LCD_DB6 PortB.4
(#)define LCD_DB7 PortB.5 on pin 13(#)define LCD_NO_RW1 ;ground the RW line on LCD
(#)define ENCODER_A PortB.6 ;sometimes called CLK
(#)define ENCODER_B PortB.7 ;sometimes called DT
(#)define ENCODER_SW PortA.0 ;the central switch
;Variables
Dim value, latched As integer
lcdcmd 40 ;2-line LCD mode
value = 0 ;begin encoder at 0
latched = 0
Do Forever
encoder(value, latched, 100) ;between 0 and 100, inclusive
locate 0,0 ;print current value
print "Current: "
print value
print " "
locate 1,0 ;print the latched value
print "Latched: "
print latched
print " "
loop
Thanks!
Last edit: bss1 2015-03-02
We can help.
I need encoder.h and the source. As the (#) and the posting process means there may be errors in the posting that may be causing other issues.
Post as a zip.
However, define LCD_DB7 PortB.5 on pin 13 is missing a semi-colon.
Thanks,
Here is the Zip's
I needed to put parantheses on the (#) as the text otherwise would become very large in here!
I'm aware of the missing semi-colon, my fault during edit, sorry!
1) Download the Latest LCD.H and copy it to the greatcowbasic/include/lowlevel folder
https://sourceforge.net/p/gcbasic/code/HEAD/tree/GCBASIC/trunk/include/lowlevel/lcd.h?format=raw
2) Copy encoder.h to the greatcowbasic/include folder
3) Use < > instead of quotes to include encoder.h in the main program
4) Do not include LCD.H in the program. Any library that is in the lowlevel folder and listed in the /include/lowlevel.dat file is automatically included.
5) correct formatting error in program
When I did the above, the program below compiles without error.
William
Done the above mentioned, still the GCB compiler returns the fault.
I've tried to install the GCB@syn and compile through this, this time this error appears:
LCDENC.gcb (27): Error: Array/Function ENCODER has not been declared
LCDENC.gcb (27): Error: Syntax Error
The message has been logged to the file Errors.txt.
Forget about this, after copying the .h file to the gcb@syn folder it Works.
But still, how come that I get the errors in GCB graphical when I compile and not in the GCB@syn?
Thanks to both of you.... I like this program more and more...