convert string value into binary or decimal
Posted: Mon Nov 05, 2018 10:33 am
In a 485 serial network, one master and 4 slaves boards. Each Slave board read the position of 02 switchs attach with its port and send the switch logic state to master as a string.
For example if both 02 switchs are logic high it send string “11” and if both low it send string “00”.
master receive all 08 switches positions from slaves and adding them in a single string i.e “11110110” and this single string is the binary representation of all switches. Now my problem is how to convert this string value again to binary or decimal.?
For example if both 02 switchs are logic high it send string “11” and if both low it send string “00”.
master receive all 08 switches positions from slaves and adding them in a single string i.e “11110110” and this single string is the binary representation of all switches. Now my problem is how to convert this string value again to binary or decimal.?