1 pièce(s) jointe(s)
lecture une donnée flottante
Bonjour
j'essaye de lire une donnée flottante dans un registre, j'ai fais un record pour lire. quelqu'un peut m'aidez
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
procedure TForm6.BluetoothLE1CharacteristicRead(const Sender: TObject; const ACharacteristic: TBluetoothGattCharacteristic; AGattStatus: TBluetoothGattStatus);
Type
data = record
case n: integer of
0: (intdata: array[0..1] of word);
1: (floatdata: single);
end;
//Reception trame
Buffer := ACharacteristic.GetValue;
begin
for i:= 0 to Length(Buffer)-1 do
s:=s+IntToHex(Buffer[i]);
Memo1.Lines.Add( ' réponseLecture : ' + s );
end; |