fix sensor ordering

master
logchan 2020-02-20 10:12:43 +09:00
parent 0e73ef361f
commit 8f2bbb656f
1 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ namespace chuni_hands {
public static MemoryMappedViewAccessor _accessor;
private static bool _init = false;
private static readonly int[] SensorMap = new int[] { 1, 0, 3, 2, 5, 4 };
public static void Send(IList<Sensor> sensors) {
if (!_init) {
Initialize();
@ -17,7 +17,7 @@ namespace chuni_hands {
var data = new byte[6];
for (var i = 0; i < 6; ++i) {
data[i] = (byte) (sensors[i].Active ? 0x80 : 0x00);
data[SensorMap[i]] = (byte) (sensors[i].Active ? 0x80 : 0x00);
}
_accessor.WriteArray(0, data, 0, 6);