http://www.picbasic.co.uk/forum/showthread.php?t=1742

Code and schematic are key....