Demonstration of MSGEQ7 library interfacing with MSGEQ7 7-band Graphic Equalizer Chip made by Mixed Signal Integration.
main.cpp@0:96716743b93d, 2013-10-16 (annotated)
- Committer:
- chrisisthefish
- Date:
- Wed Oct 16 06:45:05 2013 +0000
- Revision:
- 0:96716743b93d
Initial creation of MSGEQ7_Hello_World application
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chrisisthefish | 0:96716743b93d | 1 | // MSGEQ7_Hello_World |
chrisisthefish | 0:96716743b93d | 2 | // Created by Chris Wilson |
chrisisthefish | 0:96716743b93d | 3 | // 10/16/2013 |
chrisisthefish | 0:96716743b93d | 4 | |
chrisisthefish | 0:96716743b93d | 5 | |
chrisisthefish | 0:96716743b93d | 6 | #include "mbed.h" |
chrisisthefish | 0:96716743b93d | 7 | #include "MSGEQ7.h" |
chrisisthefish | 0:96716743b93d | 8 | |
chrisisthefish | 0:96716743b93d | 9 | #define MAX 500 |
chrisisthefish | 0:96716743b93d | 10 | |
chrisisthefish | 0:96716743b93d | 11 | MSGEQ7 eq(p13, p14, p15); //reset, strobe, analog |
chrisisthefish | 0:96716743b93d | 12 | |
chrisisthefish | 0:96716743b93d | 13 | int main() { |
chrisisthefish | 0:96716743b93d | 14 | while(1) { |
chrisisthefish | 0:96716743b93d | 15 | eq.readInt(MAX); //Read in integer frequency data with max value set to 'MAX' |
chrisisthefish | 0:96716743b93d | 16 | |
chrisisthefish | 0:96716743b93d | 17 | //Print out frequency data |
chrisisthefish | 0:96716743b93d | 18 | for(int i = 0; i < 7; i++){ |
chrisisthefish | 0:96716743b93d | 19 | printf("%d\t", eq.freqDataInt[i]); |
chrisisthefish | 0:96716743b93d | 20 | } |
chrisisthefish | 0:96716743b93d | 21 | printf("\n"); |
chrisisthefish | 0:96716743b93d | 22 | } |
chrisisthefish | 0:96716743b93d | 23 | } |