Onward! Let’s make this thing move! (Part 1 – So… how do we make this thing move?)
Making Hero drive forward and backward at varying speeds ended up being probably the simplest interface I’ve created for him yet. The entire interaction can be described in 1 byte (8 bits). 1 bit provides power (on [1] or off [0]), another tells direction (forward [0] or reverse [1]). The next 6 bits are configured in sequence allowing for speed control between 1 to 63 using the following code:
DDRB = DDRB | B00111111;
Then it’s just a simple matter of ensuring that the Arduino ports are correctly mapped to the Hero I/O ports.