The digital to analog converter (DAC) in the RFzero can be used to make a real analog voltage with up to 10 bits resolution. This means that the voltage is not emulated like in the case of Pulse Width Modulation (PWM).
In the below example the voltage made by the DAC is set to 1 V using 10 bits/1024 steps 0-1023 resolution. Default is eight bits resolution, i.e. 256 steps 0-255.
// RFzero include and object creation
#include <RFzero.h> // MUST ALWAYS be included for RFzero
analogWriteResolution(10); // Change the DAC resolution to 10 bits, i.e. 1024 steps
analogWrite(A0, 310); // Set the DAC to 1 V, i.e. value = 1023 * Uout / 3,3 V
If you want to use the above example on your Arduino Zero or Arduino M0 the DAC is on the same pin/port A0/DAC.
If the analog voltage needs to be amplified a operational amplifier (Op Amp) implemented as a DC-coupled and non-inverting amplifier is a good solution, e.g. LM324 see section 8.2.1.
Example of a DC amplifier using a LM324 Op Amp in non-inverting configuration. Picture courtesy Texas Instruments and own work.
|Output voltage range|
|R1 (E96, 1%)|
|R2 (E96, 1%)
|0,0 - 4,0||1,21||10||2,1||2,10|
|0,0 - 5,0||1,52||10||5,1||5,11|
|0,0 - 8,0||2,42||10||14,2||14,3|
|0,0 - 12,0||3,64||10||26,4||26,1|
|0,0 - 13,8||4,18||10||31,8||31,6|