A few days ago I read about the new Pi zero revision, that now includes a camera connector. I remember thinking, why add a camera connector? Why not add a bigger USB port or on-board wifi? A couple of hours later, wondering about how well my magnetometer would be able to locate a point in the sky, the penny dropped: with a camera connected, a final correction to the telescope position could be made. I only need to figure out how to match an observed image with an expected image.
Maple Yang has already connected a camera and Raspberry Pi on an equatorial mount, and wrote a Python program to autoguide the mount.
Also checkout the blog post Astrophotography with the camera board on the official Raspberry site, that describes the work of Cristos Vasilas. Not for guiding, but for photography. Also check the comments, where a lot of people describe or link to similar efforts and more :^)