analogRead()函數 @arduino


三軸加速度計與ard板連接好后,最重要的一個通訊函數就是analogRead(),這個函數的意思如下:

  Reads the value from the specified analog pin. The Arduino board contains a 6 channel (8 channels on the Mini and Nano, 16 on the Mega), 10-bit analog to digital converter. This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. This yields a resolution between readings of: 5 volts / 1024 units or, .0049 volts (4.9 mV) per unit. The input range and resolution can be changed using analogReference().

  從指定的模擬插孔讀取數據.ard板包含6個通道(Mini和Nano板包含8個,Mega板包含16個),10比特模擬到數字的轉換。這意味着它將輸入的0到5伏的電壓采樣轉換為0到1023之間整數。這產生了分辨率的的說法,5伏/1024單位,或者4.9mV/單位.輸入的范圍和分辨率可以用analogReference()改變。

  It takes about 100 microseconds (0.0001 s) to read an analog input, so the maximum reading rate is about 10,000 times a second.

該函數100微秒(0.0001秒)讀一次數,因此最大的讀取速度是每秒10000次。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM