Accelerometers |
PULSIN Pin, State, Variable
where:
PULSIN is like a stopwatch which is triggered by a change in state on the input pin. The unit of measured time depends on the Stamp type being used (BS2/BS2e: 2 microseconds; BS2sx: 0.8 microseconds).
'{ $STAMP BS2 } accx VAR WORD accy VAR WORD loop: PULSIN 12, 1, accx 'read high state on pin 12 DEBUG home, ? accx PULSIN 13, 1, accy 'read high state on pin 13 DEBUG ? accy PAUSE 100 GOTO loop |