From 97888eec7adcd819e324583694891ef3d8bb5bdb Mon Sep 17 00:00:00 2001 From: Jorj Bauer Date: Wed, 15 Jul 2020 10:19:57 -0400 Subject: [PATCH] convert to MQS (move keyboard and display to suit) --- teensy/teensy-display.cpp | 8 ++++---- teensy/teensy-keyboard.cpp | 2 +- teensy/teensy-speaker.cpp | 10 ++++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/teensy/teensy-display.cpp b/teensy/teensy-display.cpp index 3d46ef3..db21b6e 100644 --- a/teensy/teensy-display.cpp +++ b/teensy/teensy-display.cpp @@ -12,10 +12,10 @@ #define PIN_RST 8 #define PIN_DC 9 -#define PIN_CS 10 -#define PIN_MOSI 11 -#define PIN_MISO 12 -#define PIN_SCK 13 +#define PIN_CS 0 +#define PIN_MOSI 26 +#define PIN_MISO 1 +#define PIN_SCK 27 // Inside the 320x240 display, the Apple display is 280x192. // (That's half the "correct" width, b/c of double-hi-res.) diff --git a/teensy/teensy-keyboard.cpp b/teensy/teensy-keyboard.cpp index 4558ef5..7912fbc 100644 --- a/teensy/teensy-keyboard.cpp +++ b/teensy/teensy-keyboard.cpp @@ -16,7 +16,7 @@ char keys[ROWS][COLS] = { }; uint8_t rowsPins[ROWS] = { 33, 34, 35, 36, 37 }; -uint8_t colsPins[COLS] = { 0, 1, 3, 4, 24, 25, 26, 27, 28, 29, 30, 31, 32 }; +uint8_t colsPins[COLS] = { 41, 40, 3, 4, 24, 25, 39, 23, 28, 29, 30, 31, 32 }; // 0, 1, 26, 27 are moving to ... 41, 40, 39, 23? Keypad keypad(makeKeymap(keys), rowsPins, colsPins, ROWS, COLS); LRingBuffer buffer(10); // 10 keys should be plenty, right? diff --git a/teensy/teensy-speaker.cpp b/teensy/teensy-speaker.cpp index 52e0453..6e9c933 100644 --- a/teensy/teensy-speaker.cpp +++ b/teensy/teensy-speaker.cpp @@ -5,13 +5,14 @@ #include TeensyAudio audioDriver; -//AudioMixer4 mixer2; //xy=280,253 +AudioMixer4 mixer2; //xy=280,253 AudioMixer4 mixer1; //xy=280,175 -AudioOutputI2S i2s; //xy=452,189 +//AudioOutputI2S i2s; //xy=452,189 +AudioOutputMQS i2s; //xy=452,189 AudioConnection patchCord1(audioDriver, 0, mixer1, 0); -//AudioConnection patchCord2(audioDriver, 0, mixer2, 0); -//AudioConnection patchCord3(mixer2, 0, i2s, 1); +AudioConnection patchCord2(audioDriver, 0, mixer2, 0); +AudioConnection patchCord3(mixer2, 0, i2s, 1); AudioConnection patchCord4(mixer1, 0, i2s, 0); #include "globals.h" @@ -55,6 +56,7 @@ TeensySpeaker::~TeensySpeaker() void TeensySpeaker::begin() { mixer1.gain(0, 0.1f); // left channel + mixer1.gain(1, 0.1f); // right channel memset(soundBuf, 0, sizeof(soundBuf));