Air Pressure Sensors |
PULSOUT Pin, Period
where:
PULSOUT sets the pin to output mode, inverts its state, waits for the specified "period", and then returns the pin to its original state.
SHIFTIN Dpin, Cpin, Mode, [ Variable {\Bits} {, Variable {\Bits}...}]
where:
'{ $STAMP BS2 } adcbits VAR BYTE cs CON 0 '0831 "chip select" pin clk CON 1 '0831 clock pin d0 CON 2 '0831 data pin loop: HIGH cs 'set CS pin high LOW cs 'set CS pin low ... starts conversion LOW clk 'clock pulse needs to start low PULSOUT clk, 210 'clock pulse tells 0831 to start on next pulse SHIFTIN d0, clk, MSBPOST, [adcbits\8] 'MSBPOST: msb first, sample bits after clock pulse DEBUG home DEBUG "8-bit binary value: ", bin8 adcbits PAUSE 100 GOTO loop |