发表于:2008-01-16 14:59:00
3楼
轉速 n (轉/秒) = 總脈衝數 / m 齒數 / 量測時間(秒)
例:
齒數為 10, 花了 60 秒量測, 取得 6000 個脈衝數,
則轉速 n = 6000 / 10 / 60 = 10 (轉/秒) = 每秒 10 轉
脈衝數, 一般可用 Timer/Counter 卡來計數.
TMC-10, ISA Bus Timer/Counter Card
http://www.icpdas.com.cn/products/products_detail_2007.asp?pd_code=E02060TMC10
PCI-TMC12A,PCI Bus Timer/Counter Card
http://www.icpdas.com.cn/products/products_detail_2007.asp?pd_code=E01060PCITMC12A
讀到負數值, 可能是您將無號數 (WORD, unsigned short) 誤用為有號數 (signed short).