BCD and Byte

In the conversion section I find
Byte(x) where x is a variable of any type
what type other than a BCD that may be converted to a byte??
also there is no BCD to convert to, while it is important since some sensors give their output in BCD format and take BCD to set their parameters.

In the conversion section I find

Please provide a link to this

I guess as to the link

I haven't figured out what the expected output is. I also do not think the term BCD is understood.

You probably also need to provide a link for the sensors, as what these need is often a structured field crammed into a byte.

A byte is just a collection of 8 bits. It can contain anything you want and as the programmer you give it meaning in your code. For example, the bit pattern

0100 0001 (msb first)

can be read a number of ways:

  • decimal number 65 (same as hex 0x41)
  • ASCII character 'A'
  • 2 BCD integers, 4 and 1
  • a bit mask for something
    but they are all the same value/bit pattern in memory. The context of your code gives it meaning.

The reference you gave is for the standard C/C++ language cast operation that is generally used to convert between different types. For example, taking a 16 bit integer and casting it to byte eliminates the most significant 8 bits from the number. It is not a conversion to/from BCD.