MCP4725+MCP9808 code

Hello, i am wondering how i can write a program to connect this two sensors ( temperature sensor and DAC)
to cooperate together. When temperature is rising then voltage is rising too
Corresponding ranges are 0-80 celcius
40 celcius = 2.5V
Output voltage = 0-5V
I am using created libraries

Since I do not know your resources or skill set I cannot answer that knowledgeable but probably yes. Put together a prototype block diagram of your system hand drawn is ok and label the parts. You can then post that with links giving technical information on each of the hardware devices. From there you can also do a schematic. KiCad, Eagle and other schematic capture software is available on line for no charge. You need to pick a processor that has a A/D (Analog to Digital converter) built in, the external DAC (Digital to Analog Converter) will give you the output voltage you need. Using libraries is probably the best way for you to go. As you make these choices look at the appropriate libraries to be sure you understand what is happening. Generally there is more then one to choose from. Check the protocols you will be commuting with to each of these hardware devices and appropriate pull up and or termination resistors. Note both SPI and I2C can have more then one on the same bus. A good start would be to either get or purchase a copy of the Arduino cookbook. Most of what you want to do is already in there in some form.

You can keep opening new threads, but the answers will not get any better.

Start slow, get each part working from examples, then combine them.

You have yet to state in any way what relationship you are trying to make happen.

oh, sorry, I see it’s just a linear equation. Did you not have Algebra in school? No problem, those functions I mentioned in the other thread might could do the mathematics for you.

void loop()
{
// read the temperature 


place that code you got working with the sensor here


// do some secret or easy or whatever transformation from the numbers
// you get from the sensor into the numbers you want to feed the DAC

    y = m * x + b;  // whatever

// and output a voltage

place the code that runs the DAC here

}

HTH

a7