'Connect the Dios to a Vector 2 Compass func main() dim head initvector() again: head=readvector() print head goto again endfunc '------------------------------------------------------------ 'Vector 2x Routines ' This routine returns 0-359 '------------------------------------------------------------- func readvector() dim inbyte,retval gconst SCLK 1 'Vector Pin 1 gconst SS 2 'Vector Pin 4/5 gconst DAT 3 'Vector Pin 2 gconst RESET 4 'Vector Pin 17 (Optional) low SS pause 150 clear inbyte,retval shiftin DAT,SCLK,8+64+32+128,inbyte retval.byte(1)=inbyte shiftin DAT,SCLK,8+64+32+128,inbyte retval.byte(0)=inbyte high SS 'Lets return a lowres value exit retval endfunc 'This routine resets the vector 2x func initvector() high RESET output RESET,SCLK,SS input DAT high SCLK high SS low RESET pause 100 high RESET pause 200 endfunc