English
Language : 

LCD-14048 Datasheet, PDF (22/33 Pages) SparkFun Electronics – TeensyView Hookup Guide
#include <TeensyView.h> // Include the TeensyView library
///////////////////////////////////
// TeensyView Object Declaration //
///////////////////////////////////
//Standard
//#define PIN_RESET 15
//#define PIN_DC 5
//#define PIN_CS 10
//#define PIN_SCK 13
//#define PIN_MOSI 11
//Alternate (Audio)
#define PIN_RESET 2
#define PIN_DC 21
#define PIN_CS 20
#define PIN_SCK 14
#define PIN_MOSI 7
TeensyView oled(PIN_RESET, PIN_DC, PIN_CS, PIN_SCK, PIN_MOSI);
void setup()
{
// Set up audio stuff:
// Audio connections require memory to work. For more
// detailed information, see the MemoryAndCpuUsage example
AudioMemory(20);
// Enable the audio shield and set the output volume.
audioShield.enable();
audioShield.inputSelect(myInput);
audioShield.volume(0.5); //Pass­through volume
// Configure the window algorithm to use
LeftFFT.windowFunction(AudioWindowHanning1024);
RightFFT.windowFunction(AudioWindowHanning1024);
//Initialize the OLED
oled.begin();
// clear(ALL) will clear out the OLED's graphic memory.
// clear(PAGE) will clear the Arduino's display buffer.
oled.clear(ALL); // Clear the display's memory (gets rid o
f artifacts)
// To actually draw anything on the display, you must call t
he
// display() function.
oled.display();
// Give the splash screen some time to shine
delay(2000);
}
unsigned long last_time = millis();
uint8_t overlayCounter = 0;
float lastLoopTime = 0;
uint16_t lastCPU = 0;
uint16_t lastMem = 0;
float leftBands[40] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
Page 22 of 33