Hi all,
Mathematical question. I have a PCA5554A which is read by PICAXE 40X2 through I2C. There are two 10-position BCD switches connected to 4 pins of PCA5554A each. So setting the switches to something gives me a binary value of, say %00111000. This is actually 0011 or decimal 3 for the first switch and 1000 or decimal 8 for the second one. Is there a neat way to extract this without crazy length of select case or if statements? bcdtoascii or bintoascii commands seem not to achieve this.
Regards,
Edmunds
Mathematical question. I have a PCA5554A which is read by PICAXE 40X2 through I2C. There are two 10-position BCD switches connected to 4 pins of PCA5554A each. So setting the switches to something gives me a binary value of, say %00111000. This is actually 0011 or decimal 3 for the first switch and 1000 or decimal 8 for the second one. Is there a neat way to extract this without crazy length of select case or if statements? bcdtoascii or bintoascii commands seem not to achieve this.
Regards,
Edmunds