I built the OLED version of the uncanny eyes program (Adafruit_SSD1351.h driver) with a 3.1/3.2 target, adding in code from my Prop shield tests that plays RAW file from the prop shield's flash memory, and the size was:
Code:
Sketch uses 197648 bytes (75%) of program storage space. Maximum is 262144 bytes.
Global variables use 9560 bytes (14%) of dynamic memory, leaving 55976 bytes for local variables. Maximum is 65536 bytes.
Without the changes, the code size is:
Code:
Sketch uses 182740 bytes (69%) of program storage space. Maximum is 262144 bytes.
Global variables use 4836 bytes (7%) of dynamic memory, leaving 60700 bytes for local variables. Maximum is 65536 bytes.
I then switched the display type from OLED to TFT (Adafruit_ST7735.h)
Code:
Sketch uses 199104 bytes (75%) of program storage space. Maximum is 262144 bytes.
Global variables use 9564 bytes (14%) of dynamic memory, leaving 55972 bytes for local variables. Maximum is 65536 bytes.
The sizes for the TFT display without adding the audio support is:
Code:
Sketch uses 184164 bytes (70%) of program storage space. Maximum is 262144 bytes.
Global variables use 4840 bytes (7%) of dynamic memory, leaving 60696 bytes for local variables. Maximum is 65536 bytes.
I didn't try to run either one.
Note, I find I can no longer run the OLED (Adafruit_SSD1351.h) displays on a 3.2 system, but it runs fine on the 3.5 system (and presumably 3.6), once I change the SPISettings to use an 11Mhz bus speed to use the Adafruit displays. I recall that I was able to run it some time ago (year or more). I've played with various SPI and processor settings, and I haven't found a winning combination yet.
And as I've complained about before, the TFT version (Adafruit_ST7735.h) does not build on Teensy's using the current Teensy driver, since the driver never added the 128x128 display or the newer rewrite that Adafruit did to add other devices after adding the 128x128 display. Unfortunately, it will also not build if I replace just the Teensy Adafruit_ST7735 driver with the current Adafruit one, since the current Adafruit driver depends on new stuff included in Adafruit_GFX.h that also is not in the current Teensy sources. So for now, I have a version of the ST7735 driver that has the 128x128 driver in it, but not the newest rewrite.
I used a version of the source that came from Adafruit on July 15th, 2018. After I downloaded it, I selected the OLED display, used the pin assignments I use for my hacked version, and set the SPI bus speed down. This version uses 2 eyes, and I use defaultEye.h.
My defaults are:
Code:
// The pin selections here are based on the original Adafruit Learning
// System guide for the Teensy 3.x project. Some of these pin numbers
// don't even exist on the smaller SAMD M0 & M4 boards, so you may need
// to make other selections:
#define DISPLAY_DC A1 // Data/command pin for BOTH displays
#define DISPLAY_RESET A0 // Reset pin for BOTH displays
#define SELECT_L_PIN A8 // LEFT eye chip select pin
#define SELECT_R_PIN A9 // RIGHT eye chip select pin
// INPUT CONFIG (for eye motion -- enable or comment out as needed) --------
//#define JOYSTICK_X_PIN A0 // Analog pin for eye horiz pos (else auto)
//#define JOYSTICK_Y_PIN A1 // Analog pin for eye vert position (")
//#define JOYSTICK_X_FLIP // If set, reverse stick X axis
//#define JOYSTICK_Y_FLIP // If set, reverse stick Y axis
#define TRACKING // If enabled, eyelid tracks pupil
#define IRIS_PIN A2 // Photocell or potentiometer (else auto iris)
//#define IRIS_PIN_FLIP // If set, reverse reading from dial/photocell
#define IRIS_SMOOTH // If enabled, filter input from IRIS_PIN
#define IRIS_MIN 120 // Clip lower analogRead() range from IRIS_PIN
#define IRIS_MAX 720 // Clip upper "
#define WINK_L_PIN 4 // Pin for LEFT eye wink button
#define BLINK_PIN 3 // Pin for blink button (BOTH eyes)
#define WINK_R_PIN 5 // Pin for RIGHT eye wink button
#define AUTOBLINK // If enabled, eyes blink autonomously