As a child I had a total blast building and programming things with Fischertechnik: https://www.fischertechnik.de/en/playing/robot-toys
You have microswitches, photoelectric and magnetic sensors, motors and pneumatic actuators to name a few. It all came with a software to program it all in a flowchart like fashion.
I fondly remember unpacking a set at christmas and playing with it. Honestly, I think Fischertechnik had a huge impact on me and put me on the career path that I am now. While my last experience with Fischertechnik is more than a decade ago, the website seems like they haven't lost their spirit