I have a problem with my Project... My Project is about to use a Keypad with my Arduino Due to select any Voltage between 2V - 4V, to get this Voltage I use my DAC0 PIN and connect it with an OP at the end. After I finished my Code I realized that no matter which Voltage I enter it is everytime 0,01V less than it should be.. on the Internet I found a formula to calculate the right decimal number for the DAC0:
[color=#404040][b][i]V[/i]out = [i]V[/i]refX(input/2[i]N[/i]-1)+ [i]V[/i]offset[/b][/color]
I changed it to get what I need
int input2 = (((voltage/2.0)-0.56)/2.2)*4095;
If you are wondering why in the first place stands /2.0 it is for the OP at the end to get my full voltage. I tried to expanded the formula but nothing helped...
I hope I have explained it good enough that everyone can understand it. I'm looking forward to get some solutions to fix it Thank you!