Hi J-M-L, I think the goal of doing a digitalRead to see if the trigPin (sensor) is HIGH is basically when the sensor in the front of the "robot" hits, it should change directions and vice versa.
I just started coding in this language so I'm not quite sure where to start when doing this efficiently/correctly.
Thanks!