如何在Arduino中将十六进制转换为浮点值

时间:2019-05-22 14:02:57

标签: arduino type-conversion arduino-esp8266

需要一些新的帮助,并且不确定如何将Big Endian浮点数从两个字节数组转换为浮点值或从Hex转换为浮点十进制值

{
  uint8_t j, result;
  uint16_t dataval[2];

  result = node.readHoldingRegisters(8192, 2);      // slave: read (6) 16-bit registers starting at register .. to RX buffer , this address is in Decimal, so convert hex to decimal to use correct address
  if (result == node.ku8MBSuccess)                  // do something with data if read is successful
  {
    for (j = 0; j < 2; j++)                        // set to 0,1 for two datablocks
    {
      dataval[j] = node.getResponseBuffer(j);


    }

    //********************************
    String myValuea =  String(dataval[0], HEX); //Convert it into Hexadecimal
    String myValueb =  String(dataval[1], HEX); //Convert it into Hexadecimal

0 个答案:

没有答案
相关问题