I have a serial input "1111111" and I would like to convert this to a binary B1111111 that I can send to a led matrix.
I tried to search, but, all the results were misleading, led to full text to binary conversion. Please advise.
edit: This is my sample code where I am missing a step in the conversion part
LedControl mat = LedControl(DIN_PIN, CLK_PIN, CS_PIN, MAX_SEG); // MAX7219
void OneLine() {
//input
char text[] = "11111110";
//convert to binary number somehow
//show one line
mat.setRow(0, 0, convertednr);
}
strtoi()
function, which also takes a parameter with the number base used (which is 2 for binary). Please try it