Binary number stuff? [answered]

I'm running two nixies from a shift register. For this I need to output a binary number between 0 and 9 on shift register pins 0-3 (which I can do), and a second number between 0-9 on shift register pins 4-7.

How do I add the two numbers together so that they output as two separate digits? I guess it'd be binary but I don't really know where to start.

I believe you would use the "<<" or ">>" operand.

Tell us if it works!

Yes! Thank you! I'm well excited now!

This is my nixie post: Nixies: stupid questions. - #36 by cowjam - Displays - Arduino Forum

It works counting up from 0 to 99, using this code (where all the variables are integers):

void loop()                     
{
    int delayTime = 1000; 
    for (counter = 0; counter < 100; counter++)
    {
        units = counter % 10;
        tens = (counter - units) / 10;
        shifter = (units << 4) + tens;
        Serial.println(shifter);
        digitalWrite(latch, LOW);
        shiftOut(data, clock, MSBFIRST, shifter);
        digitalWrite(latch, HIGH);               
        delay(delayTime);
    }   
}

Your Welcome. What are the nixies for? How much do they cost?

baum:
Your Welcome. What are the nixies for? How much do they cost?

About £20 for 12 x IN-12 with socket and 74141, another £10 for the 12v-180v PSU.
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=400169956004&ssPageName=STRK:MEWNX:IT
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=250747824418&ssPageName=STRK:MEWNX:IT

What am I using them for? Displaying numbers! :wink:

They're just for playing with at the moment. Tonight I'll be adding a rotary encoder and (hopefully) making a safe style lock mechanism using the nixies to display the currently dialled number.

If you got larger ones you could make a sick clock! (or count-down clock, for that matter...!)

It's a matter of finding a suitable box for a clock. I'm still looking, I keep calling in to charity shops but the ones round here (Wigan, UK) are crap.