Module Ghi Đọc Thẻ SD MCU

Máy tính & Laptop > Phụ Kiện Máy Tính > Bộ chia cổng USB & Đọc thẻ nhớ || Module Ghi Đọc Thẻ SD MCU
  • Giao hàng toàn quốc
  • Được kiểm tra hàng
  • Thanh toán khi nhận hàng
  • Chất lượng, Uy tín
  • 7 ngày đổi trả dễ dàng
  • Hỗ trợ xuất hóa đơn đỏ

Giới thiệu Module Ghi Đọc Thẻ SD MCU

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———————

Thư viện SD.h

/*

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
#include

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
}
Giá KWT
Liên kết: Phấn nước Che khuyết điểm Intense Cover Cushion EX SPF50+ PA+++ fmgt