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.

29 satır
688B

  1. // This example illustrates use of SdFat's
  2. // minimal unbuffered AVR Serial support.
  3. //
  4. // This is useful for debug and saves RAM
  5. // Will not work on Due, Leonardo, or Teensy
  6. #include <SPI.h>
  7. #include <SdFat.h>
  8. #include <SdFatUtil.h>
  9. #ifdef UDR0 // Must be AVR with serial port zero.
  10. #include <MinimumSerial.h>
  11. MinimumSerial MiniSerial;
  12. void setup() {
  13. MiniSerial.begin(9600);
  14. MiniSerial.println(FreeRam());
  15. }
  16. void loop() {
  17. int c;
  18. MiniSerial.println(F("Type any Character"));
  19. while ((c = MiniSerial.read()) < 0) {}
  20. MiniSerial.print(F("Read: "));
  21. MiniSerial.println((char)c);
  22. while (MiniSerial.read() >= 0) {}
  23. }
  24. #else // UDR0
  25. #error no AVR serial port 0
  26. #endif // UDR0