Exemple #1
0
        private static void TestTiltSensorFrontUp45Degrees(ITiltSensor tiltSensor, int toleranceDegrees)
        {
            Console.WriteLine();
            ConsoleHelper.WriteLine($"Test {_testNumber}", ConsoleColor.Yellow);
            Console.WriteLine("Do a wheelie with 45° while keeping the Y-axis at 0°");
            Console.WriteLine("Press any key to continue");
            Console.ReadKey();

            var rotationResult = tiltSensor.GetRotationResult();

            TestTiltSensor(rotationResult, new RotationResult {
                XRotation = 45, YRotation = 0
            }, toleranceDegrees);
        }
Exemple #2
0
        private static void TestTiltSensorRightSideUpWhileWheelie45Degrees(ITiltSensor tiltSensor, int toleranceDegrees)
        {
            Console.WriteLine();
            ConsoleHelper.WriteLine($"Test {_testNumber}", ConsoleColor.Yellow);
            Console.WriteLine("Tilt sensor 45° to the left side like a stuntman with a car where the right wheels are no longer on the ground and do a wheelie 45° at the same time. This way only the wheel on the left back is on the ground. ");
            Console.WriteLine("Press any key to continue");
            Console.ReadKey();

            var rotationResult = tiltSensor.GetRotationResult();

            TestTiltSensor(rotationResult, new RotationResult {
                XRotation = 45, YRotation = -45
            }, toleranceDegrees);
        }
Exemple #3
0
        private static void TestTiltSensorLeftSideUp45Degrees(ITiltSensor tiltSensor, int toleranceDegrees)
        {
            Console.WriteLine();
            ConsoleHelper.WriteLine($"Test {_testNumber}", ConsoleColor.Yellow);
            Console.WriteLine("Tilt sensor 45° to the right side like a stuntman with a car where the left wheels are no longer on the ground");
            Console.WriteLine("Press any key to continue");
            Console.ReadKey();

            var rotationResult = tiltSensor.GetRotationResult();

            TestTiltSensor(rotationResult, new RotationResult {
                XRotation = 0, YRotation = 45
            }, toleranceDegrees);
        }
Exemple #4
0
        private static void TestTiltSensorFlat(ITiltSensor tiltSensor, int toleranceDegrees)
        {
            Console.WriteLine();
            ConsoleHelper.WriteLine($"Test {_testNumber}", ConsoleColor.Yellow);
            Console.WriteLine("Place the TiltSensor on a flat surface");
            Console.WriteLine("Press any key to continue");
            Console.ReadKey();

            var rotationResult = tiltSensor.GetRotationResult();

            TestTiltSensor(rotationResult, new RotationResult {
                XRotation = 0, YRotation = 0
            }, toleranceDegrees);
        }