Main Site Documentation

Audio out and pin assignment


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?


connect the wire to A3, and leave the code to the original!

static AnalogOut aout = new AnalogOut(AnalogOut.Pin.Aout0);


Maybe your missing my point Sam, but shouldn’t the analog out pin be addressed in the same syntax as every other FEZ pin?


I guess the way they did that was try to differentiate between analog in and analog out. So it would not confuse users.

It would cause more confusing to address the Analog In and out at the same manner, don’t you think?

Besides, the Analog Out (AKA - An3) is only ONE pin on the Domino. Should we not address it as Aout0?


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…