Hello. My english is not good to explain what i meant exactly, sorry about that.
I am working on a project about GPS/INS integration,i need to sample accelerometer and gyros for within 20ms but i from analog inputs, but while i need to get serial info from GPS by serial port at 4800 baud rate. How could i do both of them at the same code, is should be like this
void loop()
{
if( (millis() - lastreda_analog) > 20ms ) // sampling analog inputs 50Hz
{
// reading_analog_value
}
if( (millis() - lastread_gps_value) > 1s) // getting data at 4800 baud rate at 1 Hz
{
// reading GPS values from serial port
}