Digole
Digital Solutions
iDigole Buyer ProtectioniDigole Buyer
Protection
My shopping cart
0 Items:
Secure Checkout
Top Rated Plus
Visit Our Live Auctions
99.9% Customer's Satisfaction
 
Forum : Digole Serial Display :

 Search Forum.. 
 Creat New Topic   Reply 

Displaying a variable

Hi.

How does one display varying numbers like 0 -1024 from a pot or thermister for example? I am using a PIC16F876 and using the DS160128CTFT-46 display in UART mode. Using  port C6 TX pin.

I have it somewhat working, but I can't move the counting numbers in the X direction only the`Y direction. If I put a number in for "X "  " HSerout ["TP",4,2] "  instead of 0, I get a trailing "0" after my count number. 

Any ideas?

Thanks                    

 

 

'************************** DIGOLE PIC16F876A **********************************

DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h                  '20 LSPEED , 24 HSPEED
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1               ' Auto clear over-run errors

DEFINE OSC 20
                                                                                                                                                                                                                   
ADCON0 = %00000000
ADCON1 = %00000110

TRISA = %00000000
TRISB = %00000000
TRISC = %10000000

'******************************* VARIABLES *************************************

CNTVAL VAR BYTE

'****************************** INITIALIZE *************************************

CNTVAL = 48                       'ASCII FOR 0

pause 100                            'SCREEN BOOT UP TIME

HSerout ["DSS",0]               'DISPLAY START SCREEN  OFF(0) ON(1)
HSerout ["DC",0]                 'CONFIG SCREEN  OFF(0) ON(1)

HSerout ["CS",0]                 'CURSOR OFF(0) ON(1)
HSerout ["CL"]                    'CLEAR SCREEN
HSerout ["BL",1]                 'BACKLIGHT OFF(0) ON(1)
             
'**************************** **** MAIN ****************************************
 
START:
  
   HSerout ["TT     LCD TEST",0]         'DISPLAY TEXT
   HSerout ["TRT"]                                'MOVE TEXT TO SECOND LINE
   HSerout ["TRT"]                                'MOVE TEXT TO SECOND LINE
   
   HSerout ["SF",51]                             'SET FONT SIZE
   HSerout ["SC",25]                             'SET COLOUR
   HSerout ["TTCOUNTING",0]             'DISPLAY TEXT
   HSerout ["TRT"]                                'MOVE TEXT TO SECOND LINE
  
   HSerout ["SF",120]                          'SET FONT SIZE
   HSerout ["SC",192]                         'SET COLOUR
   HSerout ["TP",0,2]                           'SET POSITION   X,Y 
   HSerout ["TT",CNTVAL,13]             'DISPLAY VARIABLE
  
  
COUNTER:
   
   HSerout [CNTVAL,13]                   'DISPLAY 0 TO 10  COUNTING
  
   CNTVAL = CNTVAL + 1
  
   PAUSE 500
  
   IF CNTVAL > 57 THEN
    CNTVAL = 48
   ENDIF
  
  
   GOTO COUNTER
  
 

RE:Displaying a variable

 Value 13 is "Carriage Return" if it's in "TT" command, if you want to move to next line, please use value 10 (new line).
Also, "TT" command must be terminated by value 0:
("TTHello",0,"TP",1,2) is correct command, the "TP" command is working here, but:
("TTHello",13,"TP",1,2) is incorrect, because "TT" is not terminated after value 13, all letters after value 13 will display on the screen.
 

RE:Displaying a variable

 

 

 

how much temperature restistance does it require to work

Copyright Digole Digital Solutions, 2008-2017. All rights reserved.
Powered by Victor Sun