I do not know where you take BackgroundColor and FontColor,it does not work.I would like to know.
I found T6963C_WHITE and T6963C_BLACK and it's ok
Code: Select all
program DPdouze_main
include __Lib_T6963C_Consts
dim timer_vitesse_H as byte
dim timer_vitesse_L as byte
dim puls_radar as word
dim octet_serie as byte
dim emplacement_octer_recu as byte
dim buffer_reception as byte [5]
dim texte as string [5]
dim texte2 as string [5]
dim incrementeur as word
dim incrementeur2 as word
'
'
sub procedure interrupt
' if TestBit (PIR2,CCP2IF) = 1 then 'INTERRUPTION POUR PRISE DE REGIME
' timer_vitesse_H = CCPR3H
' timer_vitesse_L = CCPR3L
'' CCPR2H = 0
'' CCPR2L = 0
' 'TMR3H = 0
' TMR3L = 0
'
''
'' if PIR2.TMR3IF = 1 then 'si il a un debordement de timer 3 met une butée
'' puls_radar = 65534
'' ClearBit(PIR2,TMR3IF)' = 0 'remise à 0 du drapeau d'interruption timer 1
'' goto passetonchemin
'' end if
' puls_radar = timer_vitesse_L + ( timer_vitesse_H << 8 ) 'OK
' passetonchemin:
'
'
'
' ClearBit( PIR2,CCP2IF)' =0 ' remise en route de l interruption de capture entrée rotation
' end if
'
' ' INTERRUPTION UART .
' if (UART2_Data_Ready() = 1) then
' octet_serie = UART2_Read() 'lecture port serie
' buffer_reception [emplacement_octer_recu] = octet_serie
' inc (emplacement_octer_recu)
'
' if emplacement_octer_recu > 4 then
' emplacement_octer_recu = 0
' end if
' ClearBit( pir1,rcif)' = 0
' end if
'
end sub
sub procedure affiche_vitesse ()
Label1_Caption = texte
Label1.Font_Color = T6963C_Black 'efface le vieux texte
DrawLabel(@Label1)
wordtostr ( inc (incrementeur2),texte) ' change le texte
' Button1_Caption = texte ' cette fonction fait clignoter le texte
' DrawButton(@Button1) ' This function flashes the text
T6963C_Write_Text(texte, 0, 0, T6963C_ROM_MODE_XOR)
Label1_Caption = texte ' ecrit le nouveau texte
Label1.Font_Color = T6963C_WHITE
DrawLabel(@Label1)
end sub
main:
Start_TP()
incrementeur =0
incrementeur2 =0
while TRUE
Check_TP()
if PIR2.TMR3IF = 1 then
inc (incrementeur)
ClearBit(PIR2,TMR3IF)' = 0
if incrementeur = 3then
affiche_vitesse ()
incrementeur =0
end if
end if
wend
end.