Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 27:7e073122ddf8
- Parent:
- 26:955a1dfc2705
- Child:
- 28:ed9c1ca386fd
diff -r 955a1dfc2705 -r 7e073122ddf8 main.cpp --- a/main.cpp Sun Nov 06 04:25:40 2016 +0000 +++ b/main.cpp Sun Nov 06 04:27:40 2016 +0000 @@ -104,13 +104,9 @@ ia = ((float) adval1 / 4096.0f * AVDD - I_OFFSET - ia_supp_offset) / I_SCALE; ib = ((float) adval2 / 4096.0f * AVDD - I_OFFSET - ib_supp_offset) / I_SCALE; - ic = -ia - ib; - float u = CURRENT_U; - float v = CURRENT_V; - - alpha = u; - beta = 1 / sqrtf(3.0f) * u + 2 / sqrtf(3.0f) * v; + alpha = ia; + beta = 1 / sqrtf(3.0f) * ia + 2 / sqrtf(3.0f) * ib; d = alpha * cos_p + beta * sin_p; q = -alpha * sin_p + beta * cos_p;