OK,it works now.I replace a voltage regulator on EASYPIC 5 board from 5V to 3.3V and it works.
What I need to do to send JPG picture to TFT display?
OK,it works now.I replace a voltage regulator on EASYPIC 5 board from 5V to 3.3V and it works.
What I need to do to send JPG picture to TFT display?
start about post#41 I have provided some python code to convert arduino c code files generated by the "UTFT ImageConverter565.exe PGM " TO a pbp compatible format.What I need to do to send JPG picture to TFT display?
be aware that a 200x200 pixel image takes 80,000 bytes of flash memory. an external flash chip is more practical for this sort of thing , I have provided code to do that also
some more ways to define and animate buttons
I create a six buttons on LCD and one button must work like a push button.
When I push the button, the LED which is connected to PORTD.0 must light all the time as the button is pressed.
When I release the button LED must go off.
Is it possible to create something like that?
when a repeat enabled button is "held" it returns a BUTTON_STATE of 5
this can be the led "on" cue
when the button is "released" it returns a BUTTON_STATE of < 5 (1 or 2 )
this can be the led "off" cue
Code:LOP: GOSUB CK_BUTTON IF BUTTON_STATE[0] THEN IF BUTTON_STATE[0] >4 then PORTD.0=1 else PORTD.0=0 BUTTON_STATE[0]=0 endif endif goto lop
when I press a button and hold it the led diode is on.That is OK.when I release a button led is off.
Is it possible to make that when the button is pressed and hold, led is on, and when I connect 5V to pin PORTD.7 then led is off.
I dont now how to explain a problem.
When I press a button window is opening and when it is full open then he must stop .Stop signal is connect to PORTD.7
'-----------------------OPEN WINDOW ------------------------------------------------------
IF BUTTON_STATE[2] THEN
IF BUTTON_STATE[2] >4 then
PORTD.0=1
else
PORTD.0=0
BUTTON_STATE[2]=0
endif
endif
you could do this but ..............
a big if
is the portd.7 signal is a limit switch or an emergency stop switch ?... if it is then its best done in hardware a hung loop here could cause fire/smoke/damage or hurt
'-----------------------OPEN WINDOW ------------------------------------------------------
IF BUTTON_STATE[2] THEN
IF BUTTON_STATE[2] >4 then
if PORTD.7 ==0 then
PORTD.0=1
else
PORTD.0=0
endif
else
PORTD.0=0
BUTTON_STATE[2]=0
endif
endif
the portd.7 signal is a limit switch for max position of open window.He must disable opening,but if something goes wrong I will put a second hardware switch to disable motor.
On test board this routine works good.
I am stuck with serin2 and serout2 comands.
I use PIC18F252 for reading sensor.
BMP085 for temperature and pressure
DS3231 for time and date
BH1750 for light intensity
DHT11 for humidity
All this values I have on 2x16 LCD and it work perfect.
pressure and temperature showing on lcd like this
'DISPLAY true temperature in C
lCTemp = (B5 + 8) / 16 'Hey presto, lCTemp appears...
INTEMP = lCTemp / 10 'find value above decimal point
INTEMPOSTATAK = lCTemp // 10 'Find decimal value
LCDOut $fe,$c0+12, DEC2 INTEMP, ".", DEC2 INTEMPOSTATAK
'DISPLAY true pressure in hPa
lPres = lPres + (X1 + X2 + 3791) / 16 'lPres is the true pressure in Pa
X1 = lPres / 100+16
PRITISAK = X1 'find value above decimal point
PRITISAKOSTATAK = lPres // 100 'find value below decimal point
LCDOut $fe,$80+9 , DEC PRITISAK, "." ,DEC2 PRITISAKOSTATAK
Now I want to send all this values to TFT lcd with SEROUT2/SERIN2 commands
Transminter:
B2400 Con 16780
lPres var long
lCTemp var long
Sec VAR word
Mins VAR word
hr VAR word
date VAR WORD
mon VAR WORD
yr VAR WORD
PRITISAK VAR WORD
INTEMP VAR WORD
DHT_Humidity var word
lux var word
Serout2 PortC.7,B2400,["#OK",HR,MINS,SEC,DATE,MON,YR,INTEMP, PRITISAK,DHT_HUMIDITY,LUX]
On receiver side i have this:
create two buttons and write receive info on screen
B240 Con 16780
cnt var WORD
HR var WORD
MINS var WORD
SEC var WORD
DATE var WORD
MON var WORD
YR var WORD
LCTEMP var WORD
LPRES var WORD
DHT_HUMIDITY var WORD
LUX var WORD
buff var byte[32]
LOP2:
GOSUB CK_BUTTON
'*******SET BUTTON FOR ADJUST TIME AND DATE******************************
IF BUTTON_STATE[0]=1 THEN
PAUSE 1000
BUTTON_STATE[0]=0
ENDIF
'************NEXT BUTTON GO TO NEXT SCREEN *****************************
if BUTTON_STATE[1]=1 then
GOTO SCREEN_1
BUTTON_STATE[1]=0
endif
Serin2 PORTC.0,B2400,10,LOP2,[wait ("#OK"),HR,MINS,SEC,DATE,MON,YR,LCTEMP, LPRES,DHT_HUMIDITY,LUX]
TEXTSIZE=2
bg=0
fg=$7FF
' LR UD
GLCDC 10,200
GLCDC "Time : "
ARRAYWRITE buff,[dec2 HR,0]
GLCDSTR 70,200,buff
ARRAYWRITE buff,[dec2 MINS,0]
GLCDSTR 100,200 ,buff
ARRAYWRITE buff,[dec2 SEC,0]
GLCDSTR 130,200 ,buff
GLCDC 10,170
GLCDC "Date : "
ARRAYWRITE buff,[dec2 DATE,0]
GLCDSTR 70,170 ,buff
ARRAYWRITE buff,[dec2 MON,0]
GLCDSTR 100,170 ,buff
ARRAYWRITE buff,[dec2 YR,0]
GLCDSTR 130,170 ,buff
ARRAYWRITE buff,[DEC4 LCTEMP,0]
GLCDSTR 10,100 ,BUFF
ARRAYWRITE buff,[ DEC4 LPRES,0]
GLCDSTR 100,100 ,BUFF
ARRAYWRITE buff,[dec3 DHT_HUMIDITY,0]
GLCDSTR 200,100,buff
ARRAYWRITE buff,[dec4 LUX,0]
GLCDSTR 270,100 ,buff
GOTO LOP2
Hr,mins,sec,date,mon,yr and temp are OK
Pressure are not OK, I have on screen 0235
Lux and humidity still not connected on transmiter side I have 0 readings
Bookmarks