I've never done this with a PIC, but I have with an 8051 type. I wrote an article back in
1998 for Circuit Cellar for a small robot. You use push-button switches to program the
robots course and time to proceed in each direction, pause times, etc. It's a lot easier
than it sounds. Even on an old dinosaur 8749 controller...;o}

There's a link to the assembler source code on this page;
http://www.dtweed.com/circuitcellar/caj00092.htm#1395

You'll need to know assembler to convert it, but it does what you're looking for.