Guest User

Untitled

a guest
Sep 30th, 2024
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1.  
  2. #include "Inkplate.h" // Include Inkplate library to the sketch
  3. Inkplate display(INKPLATE_3BIT); // Create an object on Inkplate library and also set library into 3 Bit mode
  4. SdFile file; // Create SdFile object used for accessing files on SD card
  5.  
  6. void setup()
  7. {
  8. display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
  9. display.clearDisplay(); // Clear frame buffer of display
  10. display.setTextColor(BLACK); // Set text color to black
  11. display.setTextSize(3); // Set font size to 3
  12.  
  13. // Init SD card. Display if SD card is init propery or not.
  14. if (display.sdCardInit())
  15. {
  16. display.println("SD Card OK! Reading folder...");
  17. display.display();
  18.  
  19. if (sd.exists("/1/2")) {
  20. display.println("Directory exists...");
  21. display.display();
  22. } else {
  23. display.println("Directory does not exist...");
  24. display.display();
  25. }
  26. }
  27. else
  28. {
  29. // If SD card init not success, display error on screen
  30. display.println("SD Card error!");
  31. display.display();
  32. }
  33.  
  34. // Turn off the MOSFET that powers the SD card
  35. display.sdCardSleep();
  36. }
  37.  
  38. void loop()
  39. {
  40. // Nothing...
  41. }
Advertisement
Add Comment
Please, Sign In to add comment