diff --git a/src/main.c b/src/main.c
index 745d68634890b9af6618e37f16fc232179ded427..a20d00be837df47d2348e8f4c977032b2d20a502 100644
--- a/src/main.c
+++ b/src/main.c
@@ -173,7 +173,9 @@ void callback(uint gpio, uint32_t events)
 
         int avg = (rollingperc[0] + rollingperc[1] + rollingperc[2] + rollingperc[3]) / 4;
         // if zwischen 90, 110, stop
-
+        double speed = 0.9 * ((avg - 100) * (avg - 100)) + 2000;
+        speed = speed + ((1.8 * avg) - 180);
+        set_speed(speed);
         if (avg > 90 && avg < 110)
         {
             gpio_put(20, 0);