Merge branch 'DataConverter' into develop
This commit is contained in:
@@ -176,7 +176,7 @@ namespace Hardware
|
|||||||
antMessage[12] = checksum;//reminder that i am dumb :P
|
antMessage[12] = checksum;//reminder that i am dumb :P
|
||||||
|
|
||||||
|
|
||||||
bleBike?.WriteCharacteristic("6E40FEC3-B5A3-F393-E0A9-E50E24DCCA9E", antMessage);
|
bleBike.WriteCharacteristic("6e40fec3-b5a3-f393-e0a9-e50e24dcca9e", antMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,17 +51,17 @@ namespace Hardware
|
|||||||
|
|
||||||
Console.WriteLine($"Accumulated power: {accumPower} watt (Rollover 65536)");
|
Console.WriteLine($"Accumulated power: {accumPower} watt (Rollover 65536)");
|
||||||
|
|
||||||
int instantPower = (bytes[5]) | (bytes[6]>>4)<<8;
|
int instantPower = (bytes[5]) | (bytes[6] & 0b00001111)<<8;
|
||||||
|
|
||||||
|
|
||||||
if (instantPower != 0xFFF)
|
if (instantPower != 0xFFF)
|
||||||
Console.WriteLine($"Instant power: {instantPower} watt (Range 0-4094)");
|
Console.WriteLine($"Instant power: {instantPower} watt (Range 0-4094)");
|
||||||
|
|
||||||
// other flags that are not really used but might be useful
|
int trainerStatus = bytes[6] & 0b11110000; // bit 4-7
|
||||||
int trainerStatus = bytes[6] & 0b00001111; // bit 4-7
|
|
||||||
int flags = bytes[7] >> 4;
|
int flags = bytes[7] >> 4;
|
||||||
int FEState = bytes[7] & 0b00001111;
|
int FEState = bytes[7] & 0b00001111;
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -23,7 +23,25 @@ namespace ProftaakRH
|
|||||||
}
|
}
|
||||||
|
|
||||||
bLEHandler.setResistance(25);
|
bLEHandler.setResistance(25);
|
||||||
Console.ReadLine();
|
while (true)
|
||||||
|
{
|
||||||
|
string input = Console.ReadLine();
|
||||||
|
input.ToLower();
|
||||||
|
input.Trim();
|
||||||
|
if(input == "quit")
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int resistance = Int32.Parse(input);
|
||||||
|
bLEHandler.setResistance(resistance);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user