My Marlin configs for Fabrikator Mini and CTC i3 Pro B
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.

Print.h 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. Print.h - Base class that provides print() and println()
  3. Copyright (c) 2008 David A. Mellis. All right reserved.
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  15. */
  16. #ifndef Print_h
  17. #define Print_h
  18. #include <inttypes.h>
  19. #include <stdio.h> // for size_t
  20. #include "WString.h"
  21. #define DEC 10
  22. #define HEX 16
  23. #define OCT 8
  24. #define BIN 2
  25. #define BYTE 0
  26. class Print
  27. {
  28. private:
  29. void printNumber(unsigned long, uint8_t);
  30. void printFloat(double, uint8_t);
  31. public:
  32. //
  33. // Drakelive 2012-09-04
  34. //
  35. #if ARDUINO >= 100
  36. virtual size_t write(uint8_t) = 0;
  37. #else
  38. virtual void write(uint8_t) = 0;
  39. #endif
  40. // Drakelive 2012-09-04
  41. virtual void write(const char *str);
  42. virtual void write(const uint8_t *buffer, size_t size);
  43. void print(const String &);
  44. void print(const char[]);
  45. void print(char, int = BYTE);
  46. void print(unsigned char, int = BYTE);
  47. void print(int, int = DEC);
  48. void print(unsigned int, int = DEC);
  49. void print(long, int = DEC);
  50. void print(unsigned long, int = DEC);
  51. void print(double, int = 2);
  52. void println(const String &s);
  53. void println(const char[]);
  54. void println(char, int = BYTE);
  55. void println(unsigned char, int = BYTE);
  56. void println(int, int = DEC);
  57. void println(unsigned int, int = DEC);
  58. void println(long, int = DEC);
  59. void println(unsigned long, int = DEC);
  60. void println(double, int = 2);
  61. void println(void);
  62. };
  63. #endif