/*
A benchmark Test, on Teensy it will also check if pin you choose are legal
Version 1.11 (better screenFill test, test in rotation 0...3, fixed test lines results)
*/
#include <Audio.h>
#include <Wire.h> //serielle communication mit arduino
#include <SPI.h>
#include <SerialFlash.h>
#include <SSD_13XX.h>
#include "_icons/wifi.c"
#if defined(__SAM3X8E__)
#undef __FlashStringHelper::F(string_literal)
#define F(string_literal) string_literal
#endif
uint8_t errorCode = 0;
#define _dlyBetweenTests 500
/*
Teensy3.x and Arduino's
You are using 4 wire SPI here, so:
MOSI: 11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
MISO: 12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
SCK: 13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site)
ESP8266-----------------------------------
Use:
#define __CS 16 //(D0)
#define __DC 5 //(D1)
#define __RST 4 //(D2)
SCLK:D5
MOSI:D7
*/
#if defined(ESP8266)
#define __CS1 4 //GPIO4 or GPIO2
#define __DC 5 //(D1)
#else
#define __CS1 20
#define __DC 21
#endif
SSD_13XX tft = SSD_13XX(__CS1, __DC);
// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=170,126
AudioRecordQueue queue1; //xy=977,264
AudioOutputI2S i2s2; //xy=1051,188
AudioConnection patchCord1(i2s1, 0, queue1, 0);
AudioConnection patchCord2(i2s1, 0, i2s2, 0);
AudioConnection patchCord3(i2s1, 0, i2s2, 1);
AudioControlSGTL5000 AudioShield; //xy=424,439
// GUItool: end automatically generated code
const int myInput = AUDIO_INPUT_MIC;
int16_t Signal;
void setup() {
AudioShield.enable();
AudioShield.inputSelect(myInput);
AudioShield.volume(0.75);
AudioMemory(10);
queue1.begin();
AudioShield.micGain(60);
Serial.begin(38400);
tft.begin();
tft.setBrightness(15);
}
void loop() {
if (queue1.available() >= 1) // check if a package is available;
{
Serial.println("test");
Signal= *queue1.readBuffer();
Serial.println(Signal);
queue1.freeBuffer();
}
testText();
}
void testText() {
tft.clearScreen();
tft.setCursor(0, 0);
tft.setTextColor(WHITE);
tft.setTextScale(1);
tft.println("Hello World!");
tft.setTextColor(YELLOW);
}