basicbascom

Join two bytes in BASCOM-AVR


How can I join two bytes to make an 16-bit int variable in BASCOM-AVR?


Solution

  • You can find this in BASCOM index:

    varn = MAKEINT(LSB , MSB)
    

    The equivalent code is:

    varn = (256 * MSB) + LSB
    

    For example:

    varn = MAKEINT(&B00100010,&B11101101)
    

    The result is &B1110110100100010.