forked from arduino/Arduino
-
Notifications
You must be signed in to change notification settings - Fork 6
RL78 G23 128p FPB SDCard (Arduino™ Sketch)
MikiyaKobayashi edited this page Sep 30, 2025
·
1 revision
- This page describes how to run a sample sketch that writes to and reads from an SD card
- For basic information such as how to install the Arduino IDE and Arduino libraries, and how to write sketches to the board, please refer to the Quick Start Guide
This page uses the following environment and products
- Arduino IDE 2.3.6
- Arduino Library v1.2.0
- SdFat by Bill Greiman 2.3.0
- Open the Library Manager
- Enter "sdfat" in the Library Manager search form and press the "Install" button

- Insert the SD card into the Digilent Pmod SD card slot and connect it to PMOD1
- Connect the PC and RL78/G23-128p Fast Prototyping Board via USB

- Select in order: “File” → “Examples” → “SdFat” → “exampleV1” → “ReadWrite”

- Open the Serial Monitor from “Tools” or by pressing ctrl+shift+M

- After writing to the board, the following output will appear in the Serial Monitor:
Initializing SD card...initialization done.
Writing to test.txt...done.
test.txt:
testing 1, 2, 3.
- Connect the SD card to the PC
- Confirm that test.txt has been created and written correctly

You can freely change the filename and write content by modifying as shown below:
- Change the filename from "test.txt" to "mytest.txt"
- Change the write content from "testing 1, 2, 3" to "mytest changed"
Line 46
-myFile = SD.open("test.txt", FILE_WRITE);
+myFile = SD.open("mytest.txt", FILE_WRITE);
Line 50
-Serial.print("Writing to test.txt...");
+Serial.print("Writing to mytest.txt...");
Line 51
-myFile.println("testing 1, 2, 3.");
+myFile.println("mytest changed");
Line 61
-myFile=SD.open("test.txt);
+myFile=SD.open("mytest.txt");
Line 63
-Serial.println("test.txt:");
+Serial.println("mytest.txt:");
- After writing to the board, the following output will appear in the Serial Monitor:
Initializing SD card...initialization done.
Writing to mytest.txt...done.
mytest.txt:
mytest changed
- Connect the SD card to the PC
- Confirm that mytest.txt has been created and written correctly
