' {$STAMP BS2} ' {$PBASIC 2.5} '2008 mlab.uiah.fi/paja 'Experiencing FlexiForce Sensor ' ====[ I/O Definitions ]================================================= ' --- FlexForce pFlex PIN 15 ' ====[ Variables ]======================================================= ' --- FlexForce wResult VAR WORD ' === [ Initialization ]================================================== DEBUG CLS ' ====[ Main Code ]======================================================= xMain: DO HIGH pFlex ' Charge capacitor... PAUSE 2 ' ... for 2ms ' RCTIME Pin, State, Variable ' Pin: Pin number (0-15) ' State: Specifies the desired state to measure (0-1) ' Variable: the time measurement will be stored. (BS2: a unit = 2us) RCTIME pFlex, 1, wResult DEBUG DEC wResult, CR LOOP END