Skip to content
Snippets Groups Projects
Commit df5e567f authored by jamesimmanuel.magsino@stud.h-da.de's avatar jamesimmanuel.magsino@stud.h-da.de
Browse files

Testing for car

parent 46d8f417
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment