int strobePin = 7; // Strobe Pin on the MSGEQ7 int resetPin = 8; // Reset Pin on the MSGEQ7 int outPin = A5; // Output Pin on the MSGEQ7 int level[7]; // An array to hold the values from the 7 frequency bands
// Create an initial state for our pins digitalWrite (resetPin, LOW); digitalWrite (strobePin, LOW); delay (1);
// Reset the MSGEQ7 as per the datasheet timing diagram digitalWrite (resetPin, HIGH); delay (1); digitalWrite (resetPin, LOW); digitalWrite (strobePin, HIGH); delay (1);
}
void loop() {
// Cycle through each frequency band by pulsing the strobe. for (int i = 0; i < 7; i++) { digitalWrite (strobePin, LOW); delayMicroseconds (100); // Delay necessary due to timing diagram level[i] = analogRead (outPin); digitalWrite (strobePin, HIGH); delayMicroseconds (100); // Delay necessary due to timing diagram }
for (int i = 0; i < 7; i++) { Serial.print (level[i]); Serial.print (" "); }
а вы схему фильтров на микросхеме MSGEQ7 не скинете?
а какие ты используешь конденсаторы и резисторы
Что за песня
Можно скетч?
Скетч так и не нашел(((
Плохо искал
int strobePin = 7; // Strobe Pin on the MSGEQ7
int resetPin = 8; // Reset Pin on the MSGEQ7
int outPin = A5; // Output Pin on the MSGEQ7
int level[7]; // An array to hold the values from the 7 frequency bands
void setup() {
Serial.begin (9600);
// Define our pin modes
pinMode (strobePin, OUTPUT);
pinMode (resetPin, OUTPUT);
pinMode (outPin, INPUT);
// Create an initial state for our pins
digitalWrite (resetPin, LOW);
digitalWrite (strobePin, LOW);
delay (1);
// Reset the MSGEQ7 as per the datasheet timing diagram
digitalWrite (resetPin, HIGH);
delay (1);
digitalWrite (resetPin, LOW);
digitalWrite (strobePin, HIGH);
delay (1);
}
void loop() {
// Cycle through each frequency band by pulsing the strobe.
for (int i = 0; i < 7; i++) {
digitalWrite (strobePin, LOW);
delayMicroseconds (100); // Delay necessary due to timing diagram
level[i] = analogRead (outPin);
digitalWrite (strobePin, HIGH);
delayMicroseconds (100); // Delay necessary due to timing diagram
}
for (int i = 0; i < 7; i++) {
Serial.print (level[i]);
Serial.print (" ");
}
Serial.println ();
}
А куда подключать светодиоды. Это, наверное, не весь скетч?