http://gharee.com/wiki/index.php?action=history&feed=atom&title=%28SKU%3ARB-02S018A%29_TF%E5%8D%A1%E8%AF%BB%E5%86%99%E6%A8%A1%E5%9D%97 123,123,123 2025-06-30T04:14:51Z 本wiki的該頁面的版本歷史 MediaWiki 1.21.2 http://gharee.com/wiki/index.php?title=(SKU:RB-02S018A)_TF%E5%8D%A1%E8%AF%BB%E5%86%99%E6%A8%A1%E5%9D%97&diff=4692&oldid=prev Arduino77:/* 程序效果 */ 2016-01-05T06:19:06Z <p>?<span dir="auto"><span class="autocomment">程序效果</span></span></p> <table class='diff diff-contentalign-left'> <col class='diff-marker' /> <col class='diff-content' /> <col class='diff-marker' /> <col class='diff-content' /> <tr style='vertical-align: top;'> <td colspan='2' style="background-color: white; color:black; text-align: center;">←上一版本</td> <td colspan='2' style="background-color: white; color:black; text-align: center;">2016年1月5日 (二) 06:19的版本</td> </tr><tr><td colspan="2" class="diff-lineno">第138行:</td> <td colspan="2" class="diff-lineno">第138行:</td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===程序效果===</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>===程序效果===</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>程序編譯上傳無誤之后,將準(zhǔn)備好的 TF 卡插入到模塊中,連接 TF 卡模塊和 Arduino UNO 控制器,連接正常情況下,會顯示出卡的信息,如下圖所示:</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>程序編譯上傳無誤之后,將準(zhǔn)備好的 TF 卡插入到模塊中,連接 TF 卡模塊和 Arduino UNO 控制器,連接正常情況下,會顯示出卡的信息,如下圖所示:</div></td></tr> <tr><td class='diff-marker'>?</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[文件:<del class="diffchange diffchange-inline">02S018A03</del>.png|500px|有框|居中]]</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[文件:<ins class="diffchange diffchange-inline">02S018A04</ins>.png|500px|有框|居中]]</div></td></tr> <tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>&#160;</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==產(chǎn)品相關(guān)推薦==</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==產(chǎn)品相關(guān)推薦==</div></td></tr> <tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[文件:erweima.png|230px|無框|右]]</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>[[文件:erweima.png|230px|無框|右]]</div></td></tr> </table> Arduino77 http://gharee.com/wiki/index.php?title=(SKU:RB-02S018A)_TF%E5%8D%A1%E8%AF%BB%E5%86%99%E6%A8%A1%E5%9D%97&diff=4691&oldid=prev Arduino77:以“右 ==產(chǎn)品概述== 該模塊(MicroSD Card Adapter)是Micro SD卡讀寫模塊,通過文件系統(tǒng)及SPI接口驅(qū)動程序...”為內(nèi)容創(chuàng)建頁面 2016-01-05T06:17:36Z <p>以“<a href="/wiki/index.php/%E6%96%87%E4%BB%B6:02S018A01.png" title="文件:02S018A01.png">右</a> ==產(chǎn)品概述== 該模塊(MicroSD Card Adapter)是Micro SD卡讀寫模塊,通過文件系統(tǒng)及SPI接口驅(qū)動程序...”為內(nèi)容創(chuàng)建頁面</p> <p><b>新頁面</b></p><div>[[文件:02S018A01.png|500px|有框|右]]<br /> ==產(chǎn)品概述==<br /> 該模塊(MicroSD Card Adapter)是Micro SD卡讀寫模塊,通過文件系統(tǒng)及SPI接口驅(qū)動程序,單片機(jī)系統(tǒng)即可完成MicroSD卡內(nèi)的文件進(jìn)行讀寫。Arduino用戶可直接使用Arduino IDE自帶的SD卡程序庫即可完成卡的初始化和讀寫。&lt;br/&gt;<br /> 模塊特點(diǎn)如下:&lt;br/&gt;<br /> * 支持Micro SD卡、Micro SDHC卡(高速卡)<br /> * 板載電平轉(zhuǎn)換電路,即接口電平可為5V或3.3V<br /> * 供電電源為4.5V - 5.5V,板載3.3V穩(wěn)壓電路<br /> * 通信接口為標(biāo)準(zhǔn)SPI接口<br /> * 4個M2螺絲定位孔,便于安裝<br /> ==規(guī)格參數(shù)==<br /> # 工作電壓:3.3V - 5V<br /> # 產(chǎn)品尺寸:40mm * 28mm<br /> # 重量大?。?g<br /> # 信號類型:模擬信號<br /> # 固定孔:M3 * 4個<br /> # 通信接口:標(biāo)準(zhǔn) SPI 接口<br /> # 支持卡類型:Micro SD 卡(&lt; = 2G),Micro SDHC 卡(&lt; = 32G)<br /> ==接口定義==<br /> * + :電源正<br /> * - :電源地<br /> * DI :串行數(shù)據(jù)輸入<br /> * DO :串行數(shù)據(jù)輸出<br /> * CK :串行時鐘<br /> * CS :片選信號,由控制器進(jìn)行控制<br /> [[文件:02S018A02.png|500px|有框|居中]]<br /> ==使用方法==<br /> ===工作原理===<br /> TF 卡模塊使用 SPI 總線連接方式實(shí)現(xiàn)與 Arduino 控制器的通信,穩(wěn)壓芯片輸出的 3.3V 為電平轉(zhuǎn)換芯片、Micro SD 卡進(jìn)行供電,電平轉(zhuǎn)換電路往 Micro SD 卡方向的信號轉(zhuǎn)換成 3.3V,Micro SD 卡往控制接口方向的 MISO 信號也轉(zhuǎn)換成了 3.3V,一般 AVR 單片機(jī)系統(tǒng)都可以讀取該信號,產(chǎn)品使用自彈式卡座,方便卡的插拔。<br /> ===編程原理===<br /> TF 卡模塊共引出 6 個引腳,其中 DO、CK、DI 是 SPI 總線接口,“+”為電源正,“-”為電源GND,CS為片選端,實(shí)際使用時依照下面的接線圖連接即可,使用 Arduino IDE 自帶的例子程序就可以進(jìn)行測試。<br /> ===連接示意圖===<br /> [[文件:02S018A03.png|700px|有框|居中]]<br /> ===例子程序===<br /> &lt;pre style='color:blue'&gt;<br /> /*<br /> SD card test<br /> <br /> * SD card attached to SPI bus as follows:<br /> ** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila<br /> ** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila<br /> ** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila<br /> ** CS - depends on your SD card shield or module.<br /> Pin 4 used here for consistency with other Arduino examples<br /> <br /> */<br /> // include the SD library:<br /> #include &lt;SPI.h&gt;<br /> #include &lt;SD.h&gt;<br /> <br /> // set up variables using the SD utility library functions:<br /> Sd2Card card;<br /> SdVolume volume;<br /> SdFile root;<br /> <br /> // change this to match your SD shield or module;<br /> // Arduino Ethernet shield: pin 4<br /> // Adafruit SD shields and modules: pin 10<br /> // Sparkfun SD shield: pin 8<br /> const int chipSelect = 4;<br /> <br /> void setup()<br /> {<br /> // Open serial communications and wait for port to open:<br /> Serial.begin(9600);<br /> while (!Serial) {<br /> ; // wait for serial port to connect. Needed for Leonardo only<br /> }<br /> <br /> <br /> Serial.print(&quot;\nInitializing SD card...&quot;);<br /> <br /> // we'll use the initialization code from the utility libraries<br /> // since we're just testing if the card is working!<br /> if (!card.init(SPI_HALF_SPEED, chipSelect)) {<br /> Serial.println(&quot;initialization failed. Things to check:&quot;);<br /> Serial.println(&quot;* is a card inserted?&quot;);<br /> Serial.println(&quot;* is your wiring correct?&quot;);<br /> Serial.println(&quot;* did you change the chipSelect pin to match your shield or module?&quot;);<br /> return;<br /> } else {<br /> Serial.println(&quot;Wiring is correct and a card is present.&quot;);<br /> }<br /> <br /> // print the type of card<br /> Serial.print(&quot;\nCard type: &quot;);<br /> switch (card.type()) {<br /> case SD_CARD_TYPE_SD1:<br /> Serial.println(&quot;SD1&quot;);<br /> break;<br /> case SD_CARD_TYPE_SD2:<br /> Serial.println(&quot;SD2&quot;);<br /> break;<br /> case SD_CARD_TYPE_SDHC:<br /> Serial.println(&quot;SDHC&quot;);<br /> break;<br /> default:<br /> Serial.println(&quot;Unknown&quot;);<br /> }<br /> <br /> // Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32<br /> if (!volume.init(card)) {<br /> Serial.println(&quot;Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card&quot;);<br /> return;<br /> }<br /> <br /> <br /> // print the type and size of the first FAT-type volume<br /> uint32_t volumesize;<br /> Serial.print(&quot;\nVolume type is FAT&quot;);<br /> Serial.println(volume.fatType(), DEC);<br /> Serial.println();<br /> <br /> volumesize = volume.blocksPerCluster(); // clusters are collections of blocks<br /> volumesize *= volume.clusterCount(); // we'll have a lot of clusters<br /> volumesize *= 512; // SD card blocks are always 512 bytes<br /> Serial.print(&quot;Volume size (bytes): &quot;);<br /> Serial.println(volumesize);<br /> Serial.print(&quot;Volume size (Kbytes): &quot;);<br /> volumesize /= 1024;<br /> Serial.println(volumesize);<br /> Serial.print(&quot;Volume size (Mbytes): &quot;);<br /> volumesize /= 1024;<br /> Serial.println(volumesize);<br /> <br /> <br /> Serial.println(&quot;\nFiles found on the card (name, date and size in bytes): &quot;);<br /> root.openRoot(volume);<br /> <br /> // list all files in the card with date and size<br /> root.ls(LS_R | LS_DATE | LS_SIZE);<br /> }<br /> <br /> <br /> void loop(void) {<br /> <br /> }<br /> &lt;/pre&gt;<br /> ===程序效果===<br /> 程序編譯上傳無誤之后,將準(zhǔn)備好的 TF 卡插入到模塊中,連接 TF 卡模塊和 Arduino UNO 控制器,連接正常情況下,會顯示出卡的信息,如下圖所示:<br /> [[文件:02S018A03.png|500px|有框|居中]]<br /> ==產(chǎn)品相關(guān)推薦==<br /> [[文件:erweima.png|230px|無框|右]]<br /> ===產(chǎn)品購買地址===<br /> <br /> ===周邊產(chǎn)品推薦===<br /> <br /> ===相關(guān)問題解答===<br /> <br /> ===相關(guān)學(xué)習(xí)資料===<br /> [http://www.makerspace.cn/portal.php 奧松機(jī)器人技術(shù)論壇]&lt;br/&gt;</div> Arduino77