Danh sách sản phẩm

Module ghi đọc thẻ Micro SD, Moduled SD Card

Mã sản phẩm: IMA095   |   Tình trạng: Còn 22 sản phẩm có sẵn
15.000₫
  • Nhập IMA-90 giảm 90%, tối đa 2K
  • Nhập IMA-5K giảm 5k, đơn từ 199K
  • Nhập IMA-35K giảm 35k, đơn từ 499K

Mô tả sản phẩm

Module ghi đọc thẻ SD sẽ giúp ứng dụng của bạn được nhanh hơn và dễ dàng hơn khi cần đến đọc/ ghi dữ liệu từ thẻ nhớ. Module SD card có thể sử dụng với bất cứ loại vi điều khiển nào.

Có thể dùng module để làm máy MP3, lưu trữ dữ liệu cảm biến ..v.v. . Module giao tiếp với vi điều khiển qua chuẩn SPI gồm các chân MOSI,MISO,SCK,CS. Module sử dụng nguồn 3.3V hoặc 5V đều được, do đã có IC nguồn tích hợp trên board.

Thông số kỹ thuật:

  • Tương thích với cả nguồn 5V và 3.3V
  • Hỗ trợ khe cắm mở rộng
  • SD Card hỗ trợ định dạng FAT16 
  • Hỗ trợ việc recording và playback cho lượng âm thanh lớn
  • Giao tiếp thông qua chuẩn SPI (4 Pin): MOSI, SCK, MISO và CS.

Code tham khảo Arduino: 

/*
   SDcard     UNO         MEGA
  MOSI      11           51
  MISO      12           50
  SCK       13           52
  CS        10(4)       53(4)

  Gắn thẻ nhớ.
  Nạp code mở Serial Monitor chọn No line ending, baud 9600.
*/
 
#include <SPI.h>
#include <SD.h>

File myFile;

const int chipSelect = 10;

void setup()
{
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  Serial.print("Initializing SD card...");
  
   pinMode(SS, OUTPUT);
   
  if (!SD.begin(chipSelect)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");
  
  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  myFile = SD.open("test.txt", FILE_WRITE);
  
  // if the file opened okay, write to it:
  if (myFile) {
    Serial.print("Writing to test.txt...");
    myFile.println("testing 1, 2, 3.");
    // close the file:
    myFile.close();
    Serial.println("done.");
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");
  }
  
  // re-open the file for reading:
  myFile = SD.open("test.txt");
  if (myFile) {
    Serial.println("test.txt:");
    
    // read from the file until there's nothing else in it:
    while (myFile.available()) {
        Serial.write(myFile.read());
    }
    // close the file:
    myFile.close();
  } else {
      // if the file didn't open, print an error:
    Serial.println("error opening test.txt");
  }
}

void loop()
{
    // nothing happens after setup
}

Video tham khảo:

Khách hàng nhận xét