Hi there,
Connecting the robot to a router is fairly straightforward, although it does involve editing text files I'm afraid. Essentially you need to edit the network configuration in the /etc/network/interfaces file. Adafruit have a good tutorial showing how to do this
here.
With regards to adding a button to the web interface that controls pins on your Pi, you'll need to make changes to a couple of layers of the code. Firstly you need to add the button to the
web interface, the button should send a text command, something like
- Code: Select all
$( "#btnTurnOnLEDs" ).click( function() {
if ( socket.readyState == SockJS.OPEN )
{
socket.send( "TurnOnLEDs" );
}
}
Then you need to open up
robot_web_server.py and edit the command handler that starts at line 83 (on_message). You need to add a clause to handle your command, something like
- Code: Select all
elif lineData[ 0 ] == "TurnOnLEDs":
# Python code to turn on LEDs goes here
If you look at the other elif statements you should be able to get an idea of how we handle commands, and how you can pass arguments along with the commands.
Now, probably the easiest thing to do would be to control the Pi GPIO pins in Python to turn the LEDs on and off. It is possible to control the pins on the Mini Driver, but you'll need to write a fair bit more code in another 2 to 3 layers...
All the layers are there to give people a nice experience when they're getting started, but there can be a fair bit to dig through if you want to make changes.
If you decide that you'd like to control the pins on the Mini Driver then I suggest reading through this
forum post which gives a brief overview of what all the levels do, then I can give you some guidance for how to make the changes.
Hope that helps.
Regards
Alan