AD9835 to Arduino Interfacing Compile problem

I found this example code on Sparkfun to generate the frequency of 1MHz.

/**
 * \example Fixed.pde
 *
 * Fixed-frequency sinusoid generator.
 *
 * This example produces a 1MHz sinusoidal signal using the %AD9835 class
 * from the Synthesis library.
 */

#include <SPI.h>
#include "AD9835.h"

// We begin by creating the AD9835 object with the pin assignments
// that are used.  If another pinout is used, this must be
// modified.
AD9835 dds(
        7, // FSYNC
        3, // SCLK
        2, // SDATA
        6, // FSEL
        5, // PSEL1
        4, // PSEL0
        50000000 // hzMasterClockFrequency (50MHz)
    );

void setup()
{
    // We must first set up all of our output pins.
    dds.begin();
}

void loop()
{
  

    // We then set the board to produce a 1MHz signal.
    dds.setFrequencyHz(0, 1000000);
    dds.selectFrequencyRegister(0);

    // Without modulation the choice of phase offset does not matter,
    // but we set it to zero for good measure.
    dds.setPhaseDeg(0,0);
    dds.selectPhaseRegister(0);

    // Finally, we turn on the IC.
    dds.enable();
    while(1)
    {
        delay(10);
    }
}

this is the link for the library file: GitHub - LachlanGunn/Synthesis: DDS Support for Arduino

I am getting this long long error when I compile it:

AD9835.cpp:47:22: error: WProgram.h: No such file or directory
In file included from AD9835.cpp:48:
AD9835.h:22: error: 'byte' has not been declared
AD9835.h:24: error: 'byte' has not been declared
AD9835.h:25: error: 'byte' has not been declared
AD9835.h:28: error: 'byte' has not been declared
AD9835.h:29: error: 'byte' has not been declared
AD9835.h:30: error: 'byte' has not been declared
AD9835.h:34: error: 'byte' has not been declared
AD9835.h:34: error: 'byte' has not been declared
AD9835.cpp:169: error: prototype for 'void AD9835::setFrequencyCode(byte, long unsigned int)' does not match any in class 'AD9835'
AD9835.h:23: error: candidate is: void AD9835::setFrequencyCode(int, long unsigned int)
AD9835.cpp:195: error: prototype for 'void AD9835::setFrequencyHz(byte, long unsigned int)' does not match any in class 'AD9835'
AD9835.h:24: error: candidate is: void AD9835::setFrequencyHz(int, long unsigned int)
AD9835.cpp:208: error: prototype for 'void AD9835::selectFrequencyRegister(byte)' does not match any in class 'AD9835'
AD9835.h:25: error: candidate is: void AD9835::selectFrequencyRegister(int)
AD9835.cpp:219: error: prototype for 'void AD9835::setPhaseCode(byte, long unsigned int)' does not match any in class 'AD9835'
AD9835.h:28: error: candidate is: void AD9835::setPhaseCode(int, long unsigned int)
AD9835.cpp:240: error: prototype for 'void AD9835::setPhaseDeg(byte, int)' does not match any in class 'AD9835'
AD9835.h:29: error: candidate is: void AD9835::setPhaseDeg(int, int)
AD9835.cpp:253: error: prototype for 'void AD9835::selectPhaseRegister(byte)' does not match any in class 'AD9835'
AD9835.h:30: error: candidate is: void AD9835::selectPhaseRegister(int)
AD9835.cpp:312: error: prototype for 'void AD9835::writeSPI(byte, byte)' does not match any in class 'AD9835'
AD9835.h:34: error: candidate is: void AD9835::writeSPI(int, int)

Please help I m stuck...

Without having downloaded the library to check, I presume it still uses the old #include "WProgram.h" when it needs to use the new #include "Arduino.h". Look in the files of the library.

thanks a lot.... :smiley: DDs Working (Y)