Due "Dac not declared in scope"?

I need to utilize both DACs on my Arduino Due to output specified voltages. For some reason, I cant compile this simple code and keep receiving an error that the dac is not declared in the scope. I've copied and pasted other scripts including dac lines from the forum and they dont compile either which makes me think there is an issue with the board or my settings. When I go to tools and click board I see that the due is selected. Any ideas?

int v1 = 1.8; int base = 1.65; void setup() { // initialize serial communication at 9600 bits per second: //Serial.begin(9600); //pinMode(DAC0, OUTPUT); //pinMode(DAC1, OUTPUT);

}

void loop() { // put your main code here, to run repeatedly: analogWrite(DAC0, v1); delay(500); analogWrite(DAC0, base); }

int v1 = 1.8;
int base = 1.65;

Let's correct this before we go any further.

And code tags. We shall have code tags.

dac is not declared in the scope.

It's not possible that you got that error message from this code. "dac" appears nowhere in this code. You have DAC0 and DAC1. We're those the ones it complained about? Why don't you post the actual error message you received. Much easier to work with that than your synopsis of the message.

drone_control:14: error: 'DAC0' was not declared in this scope analogWrite(DAC0, v1); ^ exit status 1 'DAC0' was not declared in this scope

Got the right board selected in the Tools menu?

I believe so, I have Arduino Duemilanove or Diecimila selected

So, you do have the wrong board selected.
Sort that out and report back.

I believe so, I have Arduino Duemilanove or Diecimila selected

But you said you have a Due. Why don't you try selecting Due?

You might need to add Due support in the IDE. I don't think it's installed by default.

Go to the Boards menu and select Boards Manager.

Due support is part of the Arduino SAM Boards package.