Creating Libraries from sketches?

So far, I have a chassis that I can (just about) move forward, or backward, change it from stationary to moving, or moving to stationary, and that can make turns...

Yes, eventually, it will have sensors that allow obstacle-avoidance, and other stuff too.

You have all given me some good pointers to useful additional information and programming... I'll go and read up on your suggestions, and ask more dumb questions on the bits I don't understand!

Many thanks, all