Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Inkplate.h" // Include Inkplate library to the sketch
- Inkplate display(INKPLATE_3BIT); // Create an object on Inkplate library and also set library into 3 Bit mode
- SdFile file; // Create SdFile object used for accessing files on SD card
- void setup()
- {
- display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
- display.clearDisplay(); // Clear frame buffer of display
- display.setTextColor(BLACK); // Set text color to black
- display.setTextSize(3); // Set font size to 3
- // Init SD card. Display if SD card is init propery or not.
- if (display.sdCardInit())
- {
- display.println("SD Card OK! Reading folder...");
- display.display();
- if (sd.exists("/1/2")) {
- display.println("Directory exists...");
- display.display();
- } else {
- display.println("Directory does not exist...");
- display.display();
- }
- }
- else
- {
- // If SD card init not success, display error on screen
- display.println("SD Card error!");
- display.display();
- }
- // Turn off the MOSFET that powers the SD card
- display.sdCardSleep();
- }
- void loop()
- {
- // Nothing...
- }
Advertisement
Add Comment
Please, Sign In to add comment