Im using Audio expander to get input from 7 microphones and estimate angle of arrival of sound. And I wanna sent that angle ( posible values - 50, - 46,..., 42, 46) as voltage from 0V to 5V via analog output on Bela to Arduino analog input (which takes 0V to 5V voltage). I have converted my angle values (from - 50 to 46deg) to range of 0 to 1 float, because float 0 is 0V and float 1 is 5V for Bela when sending via analog output (correct me if I'm wrong). Also I'm using analogWriteOnce function and pass same value for every analogFrame, for example if my audioBlocksize is 512 I send same value with analogWriteOnce for 256 frames. Question here is do I get const voltage on output or should I do it something different, because I wanna create const voltage so Arduino can read it without error.
Now hardware part: I have read the blog for Audio expander and I think I did everything right but just wanna check here. I have used analogoutput pin 0 on Bela expander which is on same place as on Bela. Also in Settings I have dissabled all audio outputs. I have connected grounds from Bela and Arduino on protoboard so there is no difference there.
Did I do everything right or should I change something, because angles that Bela sends and angles that I recive on Arduino are almost the same, difference is in 4deg which is my angle resolution. Maybe I should scale angle values from 0 to 0.92 (if it caps there, I have read somewhere)?