stanleyhuangyc / Freematics

Official source code repository for Freematics
https://freematics.com
428 stars 347 forks source link

Bug When pidTier2 = 0 (empty) #11

Open hayden-t opened 9 years ago

hayden-t commented 9 years ago

Small bug in logOBDData() function, that appears if you have no pidTier2 PID's as specified by the byte array at top of datalogger.ino

This can be gotten around with a solution like this:

        if (index1 == TIER_NUM1) {
            index1 = 0;
           if(TIER_NUM2){
               queryOBDData(pidTier2[index2]);
               index2 = (index2 + 1) % TIER_NUM2;
           }
        } else {
...