I have used rx2/tx2 (the code could be altered to use tx1/rx1)On which the port and pin I connects serial communication between PC and PIC
this is the limiting factorWhat is the maximum number of buttons possible to make the TFT screen.
button_flg VAR BYTE ;1 BIT PER BUTTON make it a word to have up to 16 buttons
button state is not defined when buttons are created easiest solution is to insert a clear commandI tried to make a four keys and the fourth button is not working. The first three are working.
Code:INCLUDE "TFT_SPI.pbpmod" ;glcdc include "tft-ILI9431.bas" 'INCLUDE "flash_spi.pbpmod" include "TOUCH_TFT.PBPMOD" ;uncomment to use TOUCH_TFT INCLUDE "font7x8.bas" latb=255 ; make sure tft etc are not selected ie all cs high TRISA=111111 TRISB=000011 TRISC=010011 TRISD=000000 PORTD=0000000 OSCCON = 110000 'Internal 8 Mhz Osc OSCTUNE=000000 'PLL ON clear cont=500 ;half brightness DEFINE OSC 32 buff var byte[32] t2con=5 PR2 = 255; CCPR1L = cont>>2; ;set pwm ccp1con=12|((cont&3)<<4); SSPCON1=$20 ;$20-21-22 works 20 IS FASTESTthe screen colour has two properties fg (foreground) bg (background)how I can change color of screen wallpaper from black to yellow
set them as you like
use fg=bg and fillrect to clear an area
button_scheme var word[4] ; [background,text,border,animated (background or border) ]how I can changes color of buttons from red to green and how to change color of outline on buttons
defaults
button_scheme[0]= $1f
button_scheme[1]= $0
button_scheme[2]= $7ff
button_scheme[3]= $ffff
buttons can have different animations too
button_action.0[1]=1 ;flash text for this button1
button_action.0[2]=0 ;flash outline for this button2 ; default action




Bookmarks