RobTillaart / AD985X

Arduino library for AD9850 and AD9851 function generators.
MIT License
12 stars 2 forks source link

You could implement decimals in frequency Ver 2 #20

Closed CarlosNet closed 2 years ago

CarlosNet commented 2 years ago

Hello again Rob. something happens with the last updates in the decimal version, which does not change the frequency when uploading. it only changes integers not decimals. Can you check to see if something changed in the code? if I change values ​​below the decimal places, the frequency does not change

RobTillaart commented 2 years ago

Sorry for the late reply, I only saw the issue a few minutes ago.

Do you recall which was the working version ? Otherwise I have to go through all of them ...

Or can you post a minimal sketch so I can recreate the problem?

RobTillaart commented 2 years ago

@CarlosNet

Does the problem still exist?

Note that to set floating point values one need to use the setFrequencyF() function. Maybe you missed that difference?

Added both to be able to maximize the range of settings.

    void     setFrequency(uint32_t freq);         // 0..AD9850_MAX_FREQ
    void     setFrequencyF(float freq);           // works best for lower frequencies.