What device, specifically? If you look at the help file under SHIFTOUT and SHIFTIN you'll find examples that will get you going. Just understand that the BASIC Stamp is the SPI master and can only send (SHIFTOUT) or receive (SHIFTIN) -- not both functions at the same time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Jon Williams
Applications Engineer, Parallax
Dallas Office
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Thank you for your reply.· I'm trying to interface with a v2xe compass.· I threw together some code but didn't get much output..except "0"
' {$STAMP BS2p}
COMpin········· CON············ 11··············· 'bs input pin
COMpout········ CON············ 12
CLK············ CON············ 15··············· 'clock pin
CS············· CON············ 14··············· 'SS pin
degree········· VAR············ Word············ 'data coming from compass
Main:
LOW CS······································ 'activate the compass
SHIFTIN COMpin, CLK, MSBFIRST, [noparse][[/noparse]degree]··········· 'shift in the data
HIGH CS········································· 'deactivate the compass
DEBUG ? degree
PAUSE 1000
GOTO Main:
Any suggestions, as always, are always appreciated.
Regards,
Christopher
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Thanks, i'll move this discussion over there.· Your help is greatly appreciated.