How to send char array to shiftOut for CD4094

I'm stuck. I have a char array of numbers (6) which I am using sprintf to format for printing to a TFT display. That part is all working well. Now I am trying to use shiftOut to send the char array out to 4x cascaded CD4094 shift registers but my attempts so far have been hopeless.

I can convert each char to a digit by deducting 48.

I cant get my head around how to send those 6 digits to the cascaded shift registers.

Any help would be gratefully appreciated.

So what I ended up doing is converting the array of char to unit32_t with:

uint32_t tempNum = atof(theNumberArray);

Then I converted that number to BCD with :

unsigned long toPackedBcd(unsigned int val) {
  unsigned long bcdresult = 0; char i;
  for (i = 0; val; i++) {
    ((char*)&bcdresult)[i / 2] |= i & 1 ? (val % 10) << 4 : (val % 10) & 0xf;
    val /= 10;
  }
  return bcdresult;
}

Finally I used shiftOut to send my packed BCD out the shift registers..

Yay!

Well done.

a7