Does it say something like "... Least significant bits used" ?
If not, What errors are you getting?
<br>
Does it say something like "... Least significant bits used" ?
If not, What errors are you getting?
<br>
DT
i've imported the folowing code from this thread:
DEFINE OSC 4
INCLUDE "lcdbarIN.bas"
' Set LCD Data port
DEFINE LCD_DREG PORTB
' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_DBIT 4
' Set LCD Register Select port
DEFINE LCD_RSREG PORTB
' Set LCD Register Select bit
DEFINE LCD_RSBIT 2
' Set LCD Enable port
DEFINE LCD_EREG PORTB
' Set LCD Enable bit
DEFINE LCD_EBIT 3
' Set LCD bus size (4 or 8 bits)
DEFINE LCD_BITS 4
' Set number of lines on LCD
DEFINE LCD_LINES 2
' Set command delay time in us
DEFINE LCD_COMMANDUS 2000
' Set data delay time in us
DEFINE LCD_DATAUS 100.
DEFINE ADC_BITS 8 ' Number of bits in ADCIN result
ADCON1.7 = 1 ' Right Justify AD result
Value VAR WORD ' Must be a WORD even though AD is 8bit
pause 1000
LCDOUT $FE, 1, " "
loop1:
adcin 2,value
LCDOUT $FE,2,"Value = ",DEC Value," "
'syntax- BARgraph Value, Row, Col, Width, Range, Style
@ BARgraph _Value, 2, 0, 16, 255, lines
then i get :
Error line 14: syntax error - this one i believe it's the ADCON1.7 = 1 command
Warning Line 15: Bad token ";"
bad expression
Warning Line 16: Bad token ";"
bad expression
Warning Line 17: Bad token ";"
bad expression
Warning Line 18: Bad token ";"
bad expression
Note:
The INCLUDE "lcdbarIN.bas" line where the name of the bas file is different because i also had to change to a smaller name due to "cannot include...etc" error
.
mmm, as far as i know... grandpa 16F84 have no A/D converter... so ADCIN will never ever works with... hence why you have some strange error... i missed that forum
![]()
Last edited by mister_e; - 7th November 2007 at 23:19.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi mister_e,
you are right...but...
i tryed to comment the lines :
'DEFINE ADC_BITS 8 ' Number of bits in ADCIN result
'ADCON1.7 = 1 ' Right Justify AD result
and
'adcin 2,value
and still the same errors
.
mm, i don't remind to already have this problem... token and line # mmmm
which compiler and which version are you using?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Yup, it's probably the version.
In Post #110 there is an image from Marin that also has the same "Bad Token" errors.
Attachment 1922
The problem was PBP version 2.30 (it's just too old)
HeHe: Beat him by a minute
<br>
Last edited by Darrel Taylor; - 8th November 2007 at 05:07. Reason: mister_e
DT
@ post 110, i think i found 1 solution... or at least some tips... configuration fuse does not seems to be the one for an 16F877 anyways, and the comment should use ; instead of '
for this one... i don't know.. still thinking of the version !
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
yeah...i guess it's the version as my version is old as well.
thanks anyway
.
Bookmarks