Skip to content
Discussion options

You must be logged in to vote

As you say, eDc is a double and Vdac is a float. Simply, operate with eDc the relevant formula and, when saving the result in the variable Vdac, it will be cast directly to float. You can also put it explicitly:

float Vdac = (float)(1.65-(eDc/2.0));

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Albert-Alvarez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
C C programming
2 participants
Converted from issue

This discussion was converted from issue #60 on June 26, 2021 17:54.