You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 satır
975B

  1. /*
  2. * Program to test Short File Name character case flags.
  3. */
  4. #include <SPI.h>
  5. #include "SdFat.h"
  6. SdFat sd;
  7. SdFile file;
  8. const char* name[] = {
  9. "low.low", "low.Mix", "low.UP",
  10. "Mix.low", "Mix.Mix", "Mix.UP",
  11. "UP.low", "UP.Mix", "UP.UP"
  12. };
  13. //------------------------------------------------------------------------------
  14. void setup() {
  15. Serial.begin(9600);
  16. // Wait for USB Serial
  17. while (!Serial) {
  18. SysCall::yield();
  19. }
  20. Serial.println("type any character to start");
  21. while (Serial.read() < 0) {
  22. SysCall::yield();
  23. }
  24. if (!sd.begin()) {
  25. Serial.println("begin failed");
  26. return;
  27. }
  28. for (uint8_t i = 0; i < 9; i++) {
  29. sd.remove(name[i]);
  30. if (!file.open(name[i], O_RDWR | O_CREAT | O_EXCL)) {
  31. sd.errorHalt(name[i]);
  32. }
  33. file.println(name[i]);
  34. file.close();
  35. }
  36. sd.ls(LS_DATE|LS_SIZE);
  37. Serial.println("Done");
  38. }
  39. //------------------------------------------------------------------------------
  40. void loop() {}