#include <arduinoFFT.h>
#include <SPI.h>
#include <Wire.h>
#include <TVout.h>
PROGMEM const unsigned char TVOlogo[] = { 120,96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0xff, 0xff, 0x3f, 0xc7, 0xf8, 0x7f, 0xf8, 0x01, 0xff, 0xf0, 0x00, 0x3f, 0xf0, 0x00,
0x07, 0xff, 0xff, 0x3f, 0xcf, 0xf8, 0xff, 0xff, 0x83, 0xff, 0xfe, 0x00, 0xff, 0xfc, 0x00, 0x07,
0xff, 0xfe, 0x7f, 0xcf, 0xf8, 0xff, 0xff, 0xc3, 0xff, 0xff, 0x03, 0xff, 0xfe, 0x00, 0x0f, 0xff,
0xfe, 0x7f, 0x8f, 0xf1, 0xff, 0xff, 0xc3, 0xff, 0xff, 0x07, 0xff, 0xfe, 0x00, 0x0f, 0xff, 0xfc,
0xff, 0x9f, 0xf1, 0xff, 0x7f, 0xc7, 0xfc, 0xff, 0x0f, 0xf1, 0xfe, 0x00, 0x00, 0x7f, 0x80, 0xff,
0x1f, 0xe1, 0xfe, 0x3f, 0xc7, 0xf8, 0xff, 0x0f, 0xf1, 0xfe, 0x00, 0x00, 0xff, 0x80, 0xff, 0x1f,
0xe3, 0xfe, 0x7f, 0x87, 0xf8, 0xff, 0x1f, 0xe3, 0xfe, 0x00, 0x00, 0xff, 0x01, 0xff, 0x3f, 0xe3,
0xfc, 0x7f, 0x8f, 0xf9, 0xfe, 0x1f, 0xe3, 0xfc, 0x00, 0x01, 0xff, 0x01, 0xfe, 0x3f, 0xc3, 0xfc,
0x7f, 0x0f, 0xf1, 0xfe, 0x3f, 0xe3, 0xfc, 0x00, 0x01, 0xff, 0x03, 0xfe, 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 0xff,
0xf0, 0x7f, 0x8f, 0xe1, 0xff, 0xff, 0xc1, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xe0, 0x0f, 0xff, 0xc0,
0xff, 0x9f, 0xe3, 0xff, 0xff, 0x00, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xc0, 0x03, 0xff, 0x00, 0xff,
0x1f, 0xc1, 0xff, 0xf0, 0x00, 0x3f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x07, 0xff, 0xc0, 0x1f, 0xfc, 0x07, 0xff, 0xe3,
0xff, 0xf8, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x07, 0xff, 0x80, 0x7f, 0xff, 0x07, 0xff, 0xe3, 0xff,
0xfe, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x0f, 0xff, 0x81, 0xff, 0xff, 0x0f, 0xff, 0xc3, 0xff, 0xfe,
0x00, 0x00, 0x00, 0x7f, 0x80, 0x1f, 0xff, 0x83, 0xfe, 0xff, 0x0f, 0xff, 0xc7, 0xff, 0xfe, 0x00,
0x00, 0x00, 0x7f, 0x80, 0x1f, 0xff, 0x83, 0xfc, 0xff, 0x0f, 0xff, 0xc7, 0xf9, 0xfe, 0x00, 0x00,
0x00, 0xff, 0x80, 0x3f, 0xff, 0x87, 0xf8, 0xff, 0x1f, 0xf0, 0x0f, 0xf9, 0xfe, 0x00, 0x00, 0x00,
0xff, 0x00, 0x3f, 0xff, 0x87, 0xf8, 0xfe, 0x1f, 0xe0, 0x0f, 0xf1, 0xfe, 0x00, 0x00, 0x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xfc, 0xff, 0x1f, 0xe3, 0xff, 0xf9, 0xfe, 0x3f, 0xc0, 0x00,
0x00, 0x3f, 0xff, 0x3f, 0xc3, 0xfc, 0xff, 0xff, 0xc3, 0xff, 0xf1, 0xfe, 0x3f, 0xc0, 0x00, 0x00,
0x3f, 0xff, 0x7f, 0xc3, 0xfc, 0x7f, 0xff, 0x87, 0xff, 0xf3, 0xfe, 0x3f, 0x80, 0x00, 0x00, 0x3f,
0xfe, 0x7f, 0x87, 0xfc, 0x3f, 0xff, 0x07, 0xff, 0xe3, 0xfc, 0x7f, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
#define SAMPLES 16 // Must be a power of 2
#define MIC_IN A0 // Use A0 for mic input
#define a 2
#define b 8
#define c 6
#define d 4
#define elemente 4
int range = 500;
int bands[] = {2, 8, 6, 4};
int cHalbe;
byte boost = 1;
unsigned long buttonMillis = 0;
double vReal[SAMPLES];
double vImag[SAMPLES];
#define decrease 1
arduinoFFT FFT = arduinoFFT(); // Create FFT object
TVout TV;
const int ledPin = 1; // the number of the LED pin
int ledState = LOW; // ledState used to set the LED
unsigned long previousMillis = 0; // will store last time LED was updated
const long interval0 = 480; // interval at which to blink (milliseconds)
const long interval1 = 240; // interval at which to blink (milliseconds)
const long interval2 = 120; // interval at which to blink (milliseconds)
const long interval3 = 60; // interval at which to blink (milliseconds)
const long interval4 = 30; // interval at which to blink (milliseconds)
int band0 = 0;
int band1 = 0;
int band2 = 0;
int band3 = 0;
int band4 = 0;
int band5 = 0;
int band6 = 0;
int band7 = 0;
void setup() {
pinMode(ledPin, INPUT_PULLUP);
pinMode(MIC_IN, INPUT);
pinMode(0, INPUT_PULLUP);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);
pinMode(13, INPUT_PULLUP);
TV.begin(PAL, 120, 96);
TV.clear_screen();
delay(1000);
}
void loop() {
getSamples();
displayUpdate();
if(boost == 1){
range = 900;
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval0) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// if the LED is off turn it on and vice-versa:
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}
}
}
if(boost == 2){
range = 800;
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval1) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// if the LED is off turn it on and vice-versa:
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}
}
}
if(boost == 3){
range = 700;
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval2) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// if the LED is off turn it on and vice-versa:
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}
}
}
if(boost == 4){
range = 600;
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval3) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// if the LED is off turn it on and vice-versa:
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}
}
}
if(boost == 5){
range = 500;
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval4) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// if the LED is off turn it on and vice-versa:
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}
}
}
// set the LED with the ledState of the variable:
if(ledState == LOW){
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
}
if(ledState == HIGH){
pinMode(ledPin, INPUT_PULLUP);
}
}
void getSamples(){
for(int i = 0; i < SAMPLES; i++){
vReal[i] = analogRead(MIC_IN)-512;
vImag[i] = 0;
}
FFT.Windowing(vReal, SAMPLES, FFT_WIN_TYP_HAMMING, FFT_FORWARD);
FFT.Compute(vReal, vImag, SAMPLES, FFT_FORWARD);
FFT.ComplexToMagnitude(vReal, vImag, SAMPLES);
for(int i = 0; i < SAMPLES/2; i++){
vReal[i] = constrain(vReal[i],0 ,1047); // set max value for input data
if(vReal[i] >= range){vReal[i] = range;}
vReal[i] = map(vReal[i], 0, range, 0, 94); // map data to fit our display
}
if(vReal[0]>band0){band0 = vReal[0];}
else(band0 = band0 - decrease);
if(vReal[1]>band1){band1 = vReal[1];}
else(band1 = band1 - decrease);
if(vReal[2]>band2){band2 = vReal[2];}
else(band2 = band2 - decrease);
if(vReal[3]>band3){band3 = vReal[3];}
else(band3 = band3 - decrease);
if(vReal[4]>band4){band4 = vReal[4];}
else(band4 = band4 - decrease);
if(vReal[5]>band5){band5 = vReal[5];}
else(band5 = band5 - decrease);
if(vReal[6]>band6){band6 = vReal[6];}
else(band6 = band6 - decrease);
if(vReal[7]>band7){band7 = vReal[7];}
else(band7 = band7 - decrease);
if(band0 < 0){band0 = 0;}
if(band1 < 0){band1 = 0;}
if(band2 < 0){band2 = 0;}
if(band3 < 0){band3 = 0;}
if(band4 < 0){band4 = 0;}
if(band5 < 0){band5 = 0;}
if(band6 < 0){band6 = 0;}
if(band7 < 0){band7 = 0;}
}
void displayUpdate(){
TV.clear_screen();
if(digitalRead(0) == HIGH){
cHalbe = band2/2;
TV.draw_circle(cHalbe, cHalbe, cHalbe, WHITE, INVERT);
TV.draw_circle(119-cHalbe, cHalbe, cHalbe, WHITE, INVERT);
TV.draw_circle(119-cHalbe, 95-cHalbe, cHalbe, WHITE, INVERT);
TV.draw_circle(cHalbe, 95-cHalbe, cHalbe, WHITE, INVERT);
}
if(digitalRead(2) == HIGH){
TV.draw_circle(60, 48, band3/2, WHITE, INVERT);
}
if(digitalRead(3) == HIGH){
TV.draw_rect((60)-(band4/2),(48)-(band4/2),band4,band4,WHITE, INVERT);
}
if(digitalRead(4) == HIGH){
cHalbe = band5/2;
TV.draw_circle(cHalbe, cHalbe, cHalbe, WHITE);
TV.draw_circle(119-cHalbe, cHalbe, cHalbe, WHITE);
TV.draw_circle(119-cHalbe, 95-cHalbe, cHalbe, WHITE);
TV.draw_circle(cHalbe, 95-cHalbe, cHalbe, WHITE);
}
if(digitalRead(5) == HIGH){
TV.draw_rect(60-(band6/2),0,band6,band6,WHITE);
TV.draw_rect(60-(band6/2),95-band6,band6,band6,WHITE);
}
if(digitalRead(6) == HIGH){
for(int i = 2; i < 13; i++){
TV.draw_line(10*(i-1), 47, 10*(i-1), 47-(vReal[i]/2),WHITE);
TV.draw_line(10*(i-1), 47, 10*(i-1), 47+(vReal[i]/2),WHITE);
}
}
if(digitalRead(8) == HIGH){
TV.bitmap(0,0,TVOlogo);
}
if(digitalRead(10) == HIGH){
for(int i = 1; i < 16; i++){
TV.draw_line(8*(i-1),47-vReal[i]/2,8*(i),47-vReal[i+1]/2,WHITE);
TV.draw_line(8*(i-1),47+vReal[i]/2,8*(i),47+vReal[i+1]/2,WHITE);
}
}
if(digitalRead(12) == HIGH){
TV.draw_rect(0,0,119,95, WHITE, INVERT);
}
if(digitalRead(13) == LOW && millis() - buttonMillis > 500){
boost = boost+1;
if(boost > 5){boost = 1;}
//digitalWrite(ledPin, HIGH);
buttonMillis = millis();
}
}