Advertisement
Guest User

config

a guest
Dec 9th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.99 KB | None | 0 0
  1. // GRAPHICS SETTINGS (appearance of eye) -----------------------------------
  2.  
  3. // If using a SINGLE EYE, you might want this next line enabled, which
  4. // uses a simpler "football-shaped" eye that's left/right symmetrical.
  5. // Default shape includes the caruncle, creating distinct left/right eyes.
  6. #ifdef ADAFRUIT_HALLOWING // Hallowing, with one eye, does this by default
  7. #define SYMMETRICAL_EYELID
  8. #else // Otherwise your choice, standard is asymmetrical
  9. #define SYMMETRICAL_EYELID
  10. #endif
  11.  
  12. // Enable ONE of these #includes -- HUGE graphics tables for various eyes:
  13. #include "graphics/defaultEye.h" // Standard human-ish hazel eye -OR-
  14. //#include "graphics/dragonEye.h" // Slit pupil fiery dragon/demon eye -OR-
  15. //#include "graphics/noScleraEye.h" // Large iris, no sclera -OR-
  16. //#include "graphics/goatEye.h" // Horizontal pupil goat/Krampus eye -OR-
  17. //#include "graphics/newtEye.h" // Eye of newt
  18.  
  19. // Optional: enable this line for startup logo (screen test/orient):
  20. #if !defined ADAFRUIT_HALLOWING // Hallowing can't always fit logo+eye
  21. #include "graphics/logo.h" // Otherwise your choice, if it fits
  22. #endif
  23.  
  24. // EYE LIST ----------------------------------------------------------------
  25.  
  26. // This table contains ONE LINE PER EYE. The table MUST be present with
  27. // this name and contain ONE OR MORE lines. Each line contains THREE items:
  28. // a pin number for the corresponding TFT/OLED display's SELECT line, a pin
  29. // pin number for that eye's "wink" button (or -1 if not used), and a screen
  30. // rotation value (0-3) for that eye.
  31.  
  32. eyeInfo_t eyeInfo[] = {
  33. #ifdef ADAFRUIT_HALLOWING
  34. { 39, -1, 2 }, // SINGLE EYE display-select and wink pins, rotate 180
  35. #else
  36. // LEFT EYE display-select and wink pins, no rotation
  37. { 10, 2, 2 }, // RIGHT EYE display-select and wink pins, no rotation
  38. { 12, 2, 2 }
  39. #endif
  40. };
  41.  
  42. // DISPLAY HARDWARE SETTINGS (screen type & connections) -------------------
  43.  
  44. #ifdef ADAFRUIT_HALLOWING
  45. #include <Adafruit_ST7735.h> // TFT display library
  46. #define DISPLAY_DC 38 // Display data/command pin
  47. #define DISPLAY_RESET 37 // Display reset pin
  48. #define DISPLAY_BACKLIGHT 7
  49. #define BACKLIGHT_MAX 128
  50. #else
  51. // Enable ONE of these #includes to specify the display type being used
  52. //#include <Adafruit_SSD1351.h> // OLED display library -OR-
  53. #include <Adafruit_ST7735.h> // TFT display library (enable one only)
  54. #define DISPLAY_DC 7 // Data/command pin for ALL displays
  55. #define DISPLAY_RESET 11 // Reset pin for ALL displays
  56. #endif
  57.  
  58. #if defined(_ADAFRUIT_ST7735H_) || defined(_ADAFRUIT_ST77XXH_)
  59. #define SPI_FREQ 24000000 // TFT: use max SPI (clips to 12 MHz on M0)
  60. #else // OLED
  61. #if !defined(ARDUINO_ARCH_SAMD) && (F_CPU <= 72000000)
  62. #define SPI_FREQ 24000000 // OLED: 24 MHz on 72 MHz Teensy only
  63. #else
  64. #define SPI_FREQ 12000000 // OLED: 12 MHz in all other cases
  65. #endif
  66. #endif
  67.  
  68. // INPUT SETTINGS (for controlling eye motion) -----------------------------
  69.  
  70. // JOYSTICK_X_PIN and JOYSTICK_Y_PIN specify analog input pins for manually
  71. // controlling the eye with an analog joystick. If set to -1 or if not
  72. // defined, the eye will move on its own.
  73. // IRIS_PIN speficies an analog input pin for a photocell to make pupils
  74. // react to light (or potentiometer for manual control). If set to -1 or
  75. // if not defined, the pupils will change on their own.
  76. // BLINK_PIN specifies an input pin for a button (to ground) that will
  77. // make any/all eyes blink. If set to -1 or if not defined, the eyes will
  78. // only blink if AUTOBLINK is defined, or if the eyeInfo[] table above
  79. // includes wink button settings for each eye.
  80.  
  81. //#define JOYSTICK_X_PIN A0 // Analog pin for eye horiz pos (else auto)
  82. //#define JOYSTICK_Y_PIN A1 // Analog pin for eye vert position (")
  83. //#define JOYSTICK_X_FLIP // If defined, reverse stick X axis
  84. //#define JOYSTICK_Y_FLIP // If defined, reverse stick Y axis
  85. #define TRACKING // If defined, eyelid tracks pupil
  86. #define BLINK_PIN 1 // Pin for manual blink button (BOTH eyes)
  87. #define AUTOBLINK // If defined, eyes also blink autonomously
  88. #ifdef ADAFRUIT_HALLOWING
  89. #define LIGHT_PIN A1 // Hallowing light sensor pin
  90. #define LIGHT_CURVE 0.33 // Light sensor adjustment curve
  91. #define LIGHT_MIN 30 // Minimum useful reading from light sensor
  92. #define LIGHT_MAX 980 // Maximum useful reading from sensor
  93. #else
  94. #define LIGHT_PIN A2 // Photocell or potentiometer (else auto iris)
  95. //#define LIGHT_PIN_FLIP // If defined, reverse reading from dial/photocell
  96. #define LIGHT_MIN 0 // Lower reading from sensor
  97. #define LIGHT_MAX 1023 // Upper reading from sensor
  98. #endif
  99. #define IRIS_SMOOTH // If enabled, filter input from IRIS_PIN
  100. #if !defined(IRIS_MIN) // Each eye might have its own MIN/MAX
  101. #define IRIS_MIN 120 // Iris size (0-1023) in brightest light
  102. #endif
  103. #if !defined(IRIS_MAX)
  104. #define IRIS_MAX 720 // Iris size (0-1023) in darkest light
  105. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement