I am trying to write code to fill a buffer with real numbers from the ADC, and am getting two compiler errors at lines 25 and 29:
"Expression must have (pointer to-) function type (E109)"
//Spectrum analyser using Ivan's fft code // mods by Tony Abbey // version 31 March 2010 #include "mbed.h" #include <limits.h> #include "TextLCD.h" BusOut leds(LED1, LED2, LED3, LED4); LocalFileSystem local("local"); TextLCD lcd(p24, p25, p26, p27, p28, p29, p30); // rs, rw, e, d0, d1, d2, d3 AnalogIn ain(p20); Ticker ticker; Timer t; FILE *fp; float samples(1024); /* Sampling routine; records a buffer full */ void sample() { for(int i=0; i<1024; i++) { samples(i) = ain.read(); /* Compute next bar graph value */ leds = (1 << (int)(samples(i) * 5.0)) - 1; wait_us(10); } }
Help please
Tony
I am trying to write code to fill a buffer with real numbers from the ADC, and am getting two compiler errors at lines 25 and 29:
"Expression must have (pointer to-) function type (E109)"
//Spectrum analyser using Ivan's fft code // mods by Tony Abbey // version 31 March 2010 #include "mbed.h" #include <limits.h> #include "TextLCD.h" BusOut leds(LED1, LED2, LED3, LED4); LocalFileSystem local("local"); TextLCD lcd(p24, p25, p26, p27, p28, p29, p30); // rs, rw, e, d0, d1, d2, d3 AnalogIn ain(p20); Ticker ticker; Timer t; FILE *fp; float samples(1024); /* Sampling routine; records a buffer full */ void sample() { for(int i=0; i<1024; i++) { samples(i) = ain.read(); /* Compute next bar graph value */ leds = (1 << (int)(samples(i) * 5.0)) - 1; wait_us(10); } }
Help please
Tony