Hi Beppe,
This would involve making changes at 5 levels. Apologies in advance for the complexity. It's a side effect of trying to abstract away lower level details so that people can get started with driving their robot around, or controling it with a script running on a remote computer more quickly.
Anyway, at a very high level, the changes you need to make are
First add some code to
mini_driver_firmware.ino. I recommend perhaps modifying the way that the sensor configuration works so that you can set the digital pins to outputs. Otherwise you'll find that they're constantly set back to inputs. Whilst changing the firmware then if you update VERSION_MAJOR or VERSION_MINOR at the top then the firmware will automatically be built and uploaded to the mini driver when the web server starts.
Secondly, modify
mini_driver.py so that it can send the correct message down to your modified firmware to control the digital outputs. At the same time add something like a 'setDigitalOutput' routine to the MiniDriver class.
Thirdly, modify
robot_controller.py to have a 'setDigitalOutput' routine that passes the data onto the mini driver.
Fourthly, modify
robot_web_server.py to add a setDigitalOutput command to the web sockets interface. This is done by editing the on_message routine (line 83 onwards) in the ConnectionHandler class.
Finally, you can now modify the
web interface to call your new setDigitalOutput command via websockets.
Hopefully all of that is vaguely comprehensible, and hasn't frightened you too much. As an alternative that would probably take less work, I would suggest that you drive the LEDs from the Pi's GPIO pins. In this situation you will probably just need to take the 4th and 5th steps in that you can add some code to robot_web_server.py to talk to GPIO pins and expose it via web sockets.
Let me know if you need a bit more detail anywhere.
Regards
Alan