working-est copy with class-based code. still open loop

Dependencies:   mbed

Fork of analoghalls6 by N K

Revision:
5:ee1e6c84c302
Parent:
1:1f58bdcf2956
Child:
6:99ee0ce47fb2
--- a/modulators.cpp	Mon Mar 02 11:17:15 2015 +0000
+++ b/modulators.cpp	Tue Mar 03 06:28:10 2015 +0000
@@ -1,8 +1,8 @@
 #include "includes.h"
 #include "meta.h"
 
-void SinusoidalModulator::Update(float va, float vb) {
-    _inverter->SetDtcA(va);
-    _inverter->SetDtcB(vb);
-    _inverter->SetDtcC(1.0f - va - vb);
+void SinusoidalModulator::Update(float vb, float va) {
+    _inverter->SetDtcC(vb);
+    _inverter->SetDtcA(-vb/2.0f + sqrt(3.0f)/2.0f * va);
+    _inverter->SetDtcB(-vb/2.0f - sqrt(3.0f)/2.0f * va);
 }
\ No newline at end of file