|
@@ -13,6 +13,16 @@ namespace SketchAssistantWPF
|
|
|
|
|
|
public static class LocalArmbandInterface
|
|
|
{
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ static readonly int VIBRATION_MODE = 2;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -49,14 +59,61 @@ namespace SketchAssistantWPF
|
|
|
public static extern void StopVibration(int motorNumber);
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ [DllImport(@"../Debug/StaticLibMotors.dll", EntryPoint = "?actuate33@ArmbandInterface@@QAAXHNH@Z",
|
|
|
+ CallingConvention = CallingConvention.Cdecl)]
|
|
|
+ private static extern void Actuate33(int tactor, double intensity, int duration);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ [DllImport(@"../Debug/StaticLibMotors.dll", EntryPoint = "?actuate66@ArmbandInterface@@QAAXHNH@Z",
|
|
|
+ CallingConvention = CallingConvention.Cdecl)]
|
|
|
+ private static extern void Actuate66(int tactor, double intensity, int duration);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(@"../Debug/StaticLibMotors.dll", EntryPoint = "?actuate100@ArmbandInterface@@QAAXHNH@Z",
|
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
|
- public static extern void Actuate(int tactor, double intensity, int duration);
|
|
|
+ private static extern void Actuate100(int tactor, double intensity, int duration);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static void Actuate(int tactor, double intensity, int duration)
|
|
|
+ {
|
|
|
+ switch (VIBRATION_MODE)
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ Actuate33(tactor, intensity, duration);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ Actuate66(tactor, intensity, duration);
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ Actuate100(tactor, intensity, duration);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ Console.WriteLine("Error: invalid value for VIBRATION_MODE constant");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|