Hi as I am partially dividing the technical problems with my program I would like to ask for some advice: I dont know if this is common to do, but ill ask anyway a bother you a bit with trivial (more) questions
as i have this tftscreen Hx8357 as in the previous posts, with many other questions.
I would like to put the focus on timing and writing to the TFTscreen().
I have in total 4 thermocouples that are accessed, if put on max speed and without delay at around 3ms.
however the screen freezes over if run together with the other programs. therefore I would like to make a check on the interval of the CS pins, what would be the best approach in doing so?
the menuCheck (encoder and push button update) requires to update 20ms or (as fast as possible), and is parallel run in the if statements of the TFTScreen
what would be the best approach in timing and get a fluent output to the screen
many thanks for your time
as i have this tftscreen Hx8357 as in the previous posts, with many other questions.
I would like to put the focus on timing and writing to the TFTscreen().
I have in total 4 thermocouples that are accessed, if put on max speed and without delay at around 3ms.
however the screen freezes over if run together with the other programs. therefore I would like to make a check on the interval of the CS pins, what would be the best approach in doing so?
the menuCheck (encoder and push button update) requires to update 20ms or (as fast as possible), and is parallel run in the if statements of the TFTScreen
what would be the best approach in timing and get a fluent output to the screen
Code:
unsigned long Interval=1000;
unsigned long nowMillis;//important
unsigned long ADCpreviousMillis=0; // ADC interval
unsigned long ADCInterval=1000;
unsigned long MenupreviousMillis=0; // Pushbutton and Encoder interval
unsigned long MenuInterval=20;
unsigned long ScreenpreviousMillis=0;// controls the interval over Screen TFTscreen function
unsigned long ScreenInterval=500;
unsigned long TC_previousMillis=0;// controls the interval over the total Function over the Thermocouple1-4
unsigned long TC_Interval=500;// controls the interval over the total Function over the Thermocouple1-4
unsigned long TC_1b1_previousMillis=0; //controls the interval between the thermocouple1-4 readings
unsigned long TC_1b1_Interval=100;//controls the interval between the thermocouple1-4 readings
Code:
//give return value from function to pointer
unsigned long ScreencurrentMillis=millis();
if(ScreencurrentMillis-ScreenpreviousMillis>=ScreenInterval)
{
ScreenpreviousMillis=ScreencurrentMillis;
TFTscreen(pArray_From_TC);
}
unsigned long ADCcurrentMillis=millis();
if(ADCcurrentMillis-ADCpreviousMillis>=ADCInterval)
{
ADCpreviousMillis=ADCcurrentMillis;
InternalADC();
}
unsigned long MenucurrentMillis=millis();
if(MenucurrentMillis-MenupreviousMillis>=MenuInterval)
{
MenupreviousMillis=MenucurrentMillis;
Menu1Check();
}
unsigned long TC_currentMillis=millis();
if(TC_currentMillis-TC_previousMillis>=TC_Interval)
{
TC_previousMillis=TC_currentMillis;
pArray_From_TC=Thermocouples1_4();
}
many thanks for your time