|
@@ -2,7 +2,7 @@
|
|
extern "C" {
|
|
extern "C" {
|
|
#include "MotorHeader/BodyActuator.h"
|
|
#include "MotorHeader/BodyActuator.h"
|
|
}
|
|
}
|
|
-#include <ctime>
|
|
|
|
|
|
+#include <time.h>
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
#include "ArmbandInterface.h"
|
|
#include "ArmbandInterface.h"
|
|
#include <stdlib.h>
|
|
#include <stdlib.h>
|
|
@@ -10,7 +10,7 @@ extern "C" {
|
|
typedef void(__cdecl *InitFunctionType)(BodyActuator*, BodyActuator_Type, char*, int);
|
|
typedef void(__cdecl *InitFunctionType)(BodyActuator*, BodyActuator_Type, char*, int);
|
|
typedef void(__cdecl *StopFunctionType)(BodyActuator*, uint8_t);
|
|
typedef void(__cdecl *StopFunctionType)(BodyActuator*, uint8_t);
|
|
typedef void(__cdecl *StartFunctionType)(BodyActuator*, uint8_t, float);
|
|
typedef void(__cdecl *StartFunctionType)(BodyActuator*, uint8_t, float);
|
|
-typedef void(__cdecl *ActuateFunctionType)(BodyActuator*, uint8_t, double, uint64_t);
|
|
|
|
|
|
+typedef void(__cdecl *ActuateFunctionType)(BodyActuator*, uint8_t, float, uint64_t);
|
|
typedef void(__cdecl *DeleteFunctionType)(BodyActuator*);
|
|
typedef void(__cdecl *DeleteFunctionType)(BodyActuator*);
|
|
|
|
|
|
static InitFunctionType initFunctionHandle;
|
|
static InitFunctionType initFunctionHandle;
|
|
@@ -58,22 +58,37 @@ extern "C" {
|
|
}
|
|
}
|
|
//strcpy(port, "COM5");
|
|
//strcpy(port, "COM5");
|
|
setupMotors();
|
|
setupMotors();
|
|
|
|
+ //actuate100(0, 1.0, 20);
|
|
//startVibrate(0, 1.0);
|
|
//startVibrate(0, 1.0);
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
DllExport void __cdecl ArmbandInterface::startVibrate(int tactor, float intensity) {
|
|
DllExport void __cdecl ArmbandInterface::startVibrate(int tactor, float intensity) {
|
|
- (startFunctionHandle)(armband, (uint8_t)tactor, intensity);
|
|
|
|
|
|
+ (startFunctionHandle)(armband, 0, 1.0);
|
|
|
|
+ printf("sollte gehen");
|
|
}
|
|
}
|
|
|
|
|
|
DllExport void __cdecl ArmbandInterface::stopVibrate(int tactor) {
|
|
DllExport void __cdecl ArmbandInterface::stopVibrate(int tactor) {
|
|
(stopFunctionHandle)(armband, (uint8_t)tactor);
|
|
(stopFunctionHandle)(armband, (uint8_t)tactor);
|
|
}
|
|
}
|
|
|
|
|
|
- DllExport void __cdecl ArmbandInterface::actuate(int tactor, double intensity, int duration) {
|
|
|
|
- (actuateFunctionHandle)(armband, (uint8_t)tactor, intensity, (uint64_t)duration);
|
|
|
|
|
|
+ DllExport void __cdecl ArmbandInterface::actuate100(int tactor, float intensity, int duration) {
|
|
|
|
+ (actuateFunctionHandle)(armband, 0, 1.0, 20);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ DllExport void __cdecl ArmbandInterface::actuate66(int tactor, float intensity, int duration) {
|
|
|
|
+ (actuateFunctionHandle)(armband, 0, 0.66, 20);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DllExport void __cdecl ArmbandInterface::actuate33(int tactor, float intensity, int duration) {
|
|
|
|
+ (actuateFunctionHandle)(armband, 0, 0.33, 20);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DllExport void __cdecl ArmbandInterface::deleteArmband() {
|
|
|
|
+ (deleteFunctionHandle)(armband);
|
|
|
|
+ printf("armband deleted");
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
void ArmbandInterface::setupMotors() {
|
|
void ArmbandInterface::setupMotors() {
|
|
char* port = (char*) "COM5";//malloc(7);
|
|
char* port = (char*) "COM5";//malloc(7);
|
|
@@ -83,6 +98,10 @@ extern "C" {
|
|
printf("armband initialized");
|
|
printf("armband initialized");
|
|
}
|
|
}
|
|
|
|
|
|
- void ArmbandInterface::deleteArmband() {
|
|
|
|
- deleteFunctionHandle(armband);
|
|
|
|
- }
|
|
|
|
|
|
+ /*void ArmbandInterface::deleteArmband() {
|
|
|
|
+ (deleteFunctionHandle)(armband);
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ /*void ArmbandInterface::actuate(int tactor, double intensity, int duration) {
|
|
|
|
+ (actuateFunctionHandle)(armband, tactor, intensity, duration);
|
|
|
|
+}*/
|