I love this audio out function available with the Beta and documented here (link removed)
The one thing that I can’t figure out is the pin assignment, this is what is in the source code;
static AnalogOut aout = new AnalogOut(AnalogOut.Pin.Aout0);
I couldn’t make it work as I had the pin attached to A0. After zooming in on the picture i see that it is connected to pin A3 which is marked analog in and analog out :-[
To clean up my code I tried to use this;
static AnalogOut aout = new AnalogOut((Cpu.Pin)FEZ_Pin.AnalogOut.An3);
But that gives me an error on invalid argument (the An3 is in the intellisense)
What am I doing wrong?
do not mix analog in with PWM with analog out. There is only one analog out pin on FEZ and it is AN0…now that is AN3 for analog in. I know it can be confusing but this is the only way in-case we have more analog outputs in future.
I see. There are two different things: PIN names on hardware boards and our GHI library naming. They are seperate.
Now, to resolve this issue we have the FEZ_Pin class and you should use it.
So, you should do this and not worry about the details:
static AnalogOut aout = new AnalogOut((AnalogOut.Pin)FEZ_Pin.AnalogOut.An3);
I know this is nitpicking from my part but it seems strange that for all other pins the intellisense work for say you want an PWM pin, all usable pins are listed. But for the only analogout pin the syntax differ.
I’m not saying, I’m only saying…