I'am so angry cause I can't compile the code.Can somebody compile it and put the hex file on the forum,then I can download it and program the PIC with it.I use 2*16 LCD display.
I'am so angry cause I can't compile the code.Can somebody compile it and put the hex file on the forum,then I can download it and program the PIC with it.I use 2*16 LCD display.
Hi,
In order to compile it for you we must at least know which PIC you're using and what you're oscillator speed is.
Which version of PBP are you trying to compile this with and for which PIC?
You can't teach an old dog new tricks, but I'm always willing to try.
I fix the problem with the extension of the file LCDbar_INC.bas, but now I have this problem I compile the code but can I use 2*16 LCD display?I use PIC16F887 @ 20MHz
Last edited by SKOLS1; - 29th May 2011 at 12:45.
Sure you can.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
But now it's working,baragraph isn't showing on the LCD display,just Value: 1,2 etc.
I use 2*16 LCD display.Should I change the code in LCDbar_INC.bas
Must be intranet interference, my crystal ball refuse to give me your code, could you post your code here and PIC model, so we could see what's wrong with?![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
define OSC 20
CLEAR
INCLUDE "LCDbar_INC.bas" ' Include the BARgraph routines
' Define LCD connections
DEFINE LCD_DREG PORTB ' LCD Data Port
DEFINE LCD_DBIT 0 ' Starting Data Bit
DEFINE LCD_RSREG PORTB ' Register Select Port
DEFINE LCD_RSBIT 4 ' Register Select Bit
DEFINE LCD_EREG PORTB ' Enable Port
DEFINE LCD_EBIT 5 ' Enable Bit
DEFINE LCD_BITS 4 ' Data Bus Size
DEFINE LCD_LINES 2 ' Number of Lines on LCD
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
LCDOUT $FE, 1 ' Clear Screen
PAUSE 200
Loop1:
ADCIN 0, Value
LCDOUT $FE,2,"Value = ",DEC Value," "
; syntax- BARgraph Value, Row, Col, Width, Range, Style
@ BARgraph _Value, 2, 0, 16, 255, lines
Goto Loop1
END
I use PIC16F877 @ 20MHz(I use 8 MHz,too) I delete the frist line because there is an error in compiling
In this code what does "Rep" do? I'm using it with the Proton IDE Basic Compiler.
It works OK, but I am curious as I can't find any reference to "Rep" in the documentation.
Is it a repeat function?
Thanks, Mark
Print $FE, CGRAM, Rep $0\8,$0, Rep $10\6,$0,$0, Rep $14\6,$0,$0, Rep $15\6,$0,$0
Warnings = OFF
Byte_Math = On
BARS = (TOP_BAR Min MAXBAR) / 3 ; One full bar for each 3 graph units
BALANCE = (TOP_BAR Min MAXBAR) //3 ; Balance is the remainder after a division by 3
BALF = BALANCE Min 1
Print At 1,1, Dec3 POWERMAX, "W "
Print At 1,6, Rep FULLBAR\BARS,Rep (BALANCE + BASEBAR)\BALF,Rep " "\B_WDTH - (BARS + BALF)
BARS = (LOW_BAR Min MAXBAR) / 3 ; One full bar for each 3 graph units
BALANCE = (LOW_BAR Min MAXBAR) //3 ; Balance is the remainder after a division by 3
BALF = BALANCE Min 1
You are on the wrong forum. Here is MELABS PicBasic Forum.
But anyway, REP is just repeating the next character \times
Ioannis
Bookmarks