⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flexiforce stampdaq.bs2

📁 Parallax, Inc-StoreFront Product Detail Page
💻 BS2
字号:
' Flexiforce StampDAQ.bs2
' Example with the Flexiforce sensor and StampDAQ
' {$STAMP BS2}
' {$PBASIC 2.5}

' -----[ Declarations ]----------------------------------------------------

rawForce        VAR     word            ' Stores raw output
sensorPin       CON     15              ' Flexiforce sensor circuit
sPin            CON     16              ' Serial transmit pin
Baud            CON     84              ' 9600, 8-bit, no polarity, true

' -----[ Main Routine ]----------------------------------------------------

Initialize:
  PAUSE 1000
  SEROUT sPin,Baud,[CR]                 'prep StampDAQ buffer
  SEROUT sPin,Baud,[CR,"LABEL,rawForce",CR]     
                                        'Label column with rawForce
  SEROUT sPin,Baud,["CLEARDATA",CR]     'Clear all data 

Display:
  HIGH 15                               'Discharge capacitor
  PAUSE 2
  RCTIME sensorPin,1,rawForce           'Measure R/C charge time
  SEROUT sPin,Baud,["DATA,rawForce,", DEC rawForce,CR] 
                                        'Send data to StampDAQ
GOTO Display

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -