I drag two buttons one of which displays a static text and another to display dynamic data such as ADC measurement result.
Should I use the usual T6963C_Write_Text function to display ADC data on the other button or should I use the Caption_Text commands provided with the tool. Can you give an example showing the best method of displaying measurement results on a caption button using your library.
Text display
Re: Text display
Hi,
just load example "EasyPIC6_ADC_Demo.vglcd" and choose your programming language.
Then take a look at the file EasyPIC6_ADC_Demo_events_code, procedure Rectangle1Down and you will see the code for ADC label (Label15).
In mikroBasic it looks like this:
just load example "EasyPIC6_ADC_Demo.vglcd" and choose your programming language.
Then take a look at the file EasyPIC6_ADC_Demo_events_code, procedure Rectangle1Down and you will see the code for ADC label (Label15).
In mikroBasic it looks like this:
Code: Select all
adc_value = ADC_Get_Sample(3) ' read analog value from ADC
IntToStr(adc_value, txt)
Rtrim(txt)
Label15_Caption = txt
DrawLabel(@Label15)
SmartADAPT2 rules !
Re: Text display
I am trying to get this simple code to work:
I am doing this just to make sure I can display text later on I will add the required ADC code. This however fails. Nothing is displayed.
The compiler is MikroC 4.15 and both programs are registered. What seems to be the problem?
Code: Select all
#include "test06_objects.h"
void main() {
Start_TP();
while (1) {
Check_TP();
Label1_Caption[5]="merha";
DrawLabel(&label1);
}
}
I am doing this just to make sure I can display text later on I will add the required ADC code. This however fails. Nothing is displayed.
The compiler is MikroC 4.15 and both programs are registered. What seems to be the problem?
Re: Text display
Hi,
In C language this line :
will write to the array element with index 5.
You should include C_String library and try something like this:
just like in the ADC example project
In C language this line :
Code: Select all
Label1_Caption[5]="merha";
You should include C_String library and try something like this:
Code: Select all
strcpy(Label1_Caption, "merha");
SmartADAPT2 rules !
Re: Text display
Here is the code:
This works OK but when the line Check_TP(); is enabled, the loop stalls and it only displays the value read in the first pass. Could it be expecting a tap on the screen? There aren't any buttons or touchable objects though.
Code: Select all
#include "test06_objects.h"
void main() {
char txt[7];
int raw;
float ph;
porta=0;
trisa=255;
Start_TP();
while (1) {
// Check_TP();
raw=adc_read(0);
inttostr(raw,txt);
Rtrim(txt);
strcpy(Label1_Caption, txt);
DrawLabel(&Label1);
}
}
Re: Text display
Hi,
Visual Glcd http://www.visualglcd.com is RAD (Rapid Application Development) tool for working with displays and touch panels. Programmer only writes code for Touch Panel events (OnUp, OnDown, OnClick and OnPress).
If you want to use it only for display, then you can/should comment the Touch Panel routines.
Visual Glcd http://www.visualglcd.com is RAD (Rapid Application Development) tool for working with displays and touch panels. Programmer only writes code for Touch Panel events (OnUp, OnDown, OnClick and OnPress).
If you want to use it only for display, then you can/should comment the Touch Panel routines.
SmartADAPT2 rules !
Re: Text display
Hi milan,
that is the reason, why I made a suggestion in an other thread.
Let us disable the TP-functionality when we don't use a touch panel. I think a checkbox should disable all functions for the TP.
Regards
CS
that is the reason, why I made a suggestion in an other thread.
Let us disable the TP-functionality when we don't use a touch panel. I think a checkbox should disable all functions for the TP.
Regards
CS
Re: Text display
Hi,
your suggestion is already added to the wish list
Thank you for helping us to improve Visual GLCD tool
your suggestion is already added to the wish list
Thank you for helping us to improve Visual GLCD tool
SmartADAPT2 rules !