#pragma config(Sensor, S1, dotyk, sensorEV3_Touch, modeEV3Bump) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// task main() { int a [3]; int prumer; string s1 = "Kolo 1: "; string s2 = "Kolo 2: "; string s3 = "Kolo 3: "; string s4 = "Prumer na kolo:"; clearTimer(T1); clearTimer(T2); clearTimer(T2); resetBumpedValue(dotyk); while(true) { while (getBumpedValue(dotyk) != 1) { a[0] = time1[T1]; clearTimer(T2); clearTimer(T3); } while (getBumpedValue(dotyk) != 2) { a[1] = time1[T2]; clearTimer(T3); } while (getBumpedValue(dotyk) != 3) { a[2] = time1[T3]; } displayCenteredTextLine(1, "%s", s1); displayCenteredTextLine(4, "%s", s2); displayCenteredTextLine(7, "%s", s3); displayCenteredTextLine(2, "%d", a[0]); displayCenteredTextLine(5, "%d", a[1]); displayCenteredTextLine(8, "%d", a[2]); displayStringAt(110, 110, "ms"); displayStringAt(110, 86, "ms"); displayStringAt(110, 63, "ms"); prumer = (a[0] + a[1] + a[2]) / 3; displayCenteredTextLine(10, "%s", s4); displayCenteredTextLine(11, "%d", prumer); displayStringAt(110, 40, "ms"); } }