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.
Dependencies: mbed-dev-f303 FastPWM3
Diff: main.cpp
- Revision:
- 3:6a0015d88d06
- Parent:
- 2:8724412ad628
- Child:
- 4:c023f7b6f462
--- a/main.cpp Fri Feb 19 04:13:06 2016 +0000
+++ b/main.cpp Wed Mar 09 04:00:48 2016 +0000
@@ -42,6 +42,12 @@
void Loop(void){
foc.Commutate();
}
+
+void PrintStuff(void){
+ float velocity = encoder.GetMechVelocity();
+ float position = encoder.GetMechPosition();
+ printf("%f, %f;\n\r", position, velocity);
+ }
/*
void voltage_foc(void){
theta = encoder.GetElecPosition() + offset;
@@ -56,10 +62,12 @@
wait(1);
testing.attach(&Loop, .0001);
- //inverter.SetDTC(.2, .5, .97);
+ //testing.attach(&PrintStuff, .05);
+ //inverter.SetDTC(.1, 0, 0);
//inverter.EnableInverter();
while(1) {
-
+ //printf("%f\n\r", encoder.GetElecPosition());
+ //wait(.1);
}
}