Function Return

So I'm trying to make a binary display using digital outputs, and to avoid re-writing it like fifty times I am putting it into a sub-function. But, that sub-function doesn't seem to be cooperating and returning to the location where I called it.
Is there something that I'm just, missing? I have tried it with a 'return;' as a void function and with both 'return value;' and 'return(0);' as an int function.

Version1.ino (1.68 KB)

I would try to help if I could see your code. My device does not allow opening .ino files without a lot of hassle and I do not like downloading files. If you post code as requested in the how to use this forum-please read sticky, everyone can see it and offer help.

Thanks for the quick reply, I figured it out. It was returning but I left the outputs to HIGH between the calls so it looked like it didn't change. Here's the code for reference with all my test code still in it.

// Variables Constant
const int fan = 10;
const int heat = 11;
const int speak = A0;
const int enter = 2;
const int hourDial = A1;
const int minuteDial = A2;
const int cancel = 3;
const int one = 4;
const int two = 5;
const int four = 6;
const int eight = 7;
const int sixteen = 8;
const int thirtytwo = 9;
int call;

// Variables Change

void setup() {
// put your setup code here, to run once:
pinMode(fan, OUTPUT);
pinMode(heat, OUTPUT);
pinMode(speak, OUTPUT);
pinMode(enter, INPUT);
pinMode(hourDial, INPUT);
pinMode(minuteDial, INPUT);
pinMode(cancel, INPUT);
pinMode(one, OUTPUT);
pinMode(two, OUTPUT);
pinMode(four, OUTPUT);
pinMode(eight, OUTPUT);
pinMode(sixteen, OUTPUT);
pinMode(thirtytwo, OUTPUT);

digitalWrite(one, LOW);
digitalWrite(two, LOW);
digitalWrite(four, LOW);
digitalWrite(eight, LOW);
digitalWrite(sixteen, LOW);
digitalWrite(thirtytwo, LOW);
digitalWrite(fan, LOW);
digitalWrite(heat, LOW);

digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);

display(63);

digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);

display(14);
}

void loop() {
// put your main code here, to run repeatedly:

}

void display(int value){
digitalWrite(thirtytwo, LOW);
digitalWrite(sixteen, LOW);
digitalWrite(eight, LOW);
digitalWrite(four, LOW);
digitalWrite(two, LOW);
digitalWrite(one, LOW);
if (value <= 63) {
if ((value / 32) >= 1){
digitalWrite(thirtytwo, HIGH);
value -= 32;
}
digitalWrite(13, HIGH);
delay(100);
if ((value / 16) >= 1) {
digitalWrite(sixteen, HIGH);
value -= 16;
}
delay(100);
if ((value / 8) >= 1) {
digitalWrite(eight, HIGH);
value -= 8;
}
delay(100);
if ((value / 4) >= 1) {
digitalWrite(four, HIGH);
value -= 4;
}
delay(100);
if ((value / 2) >= 1) {
digitalWrite(two, HIGH);
value -= 2;
}
delay(100);
if ((value / 1) >= 1) {
digitalWrite(one, HIGH);
value -= 1;
}
}
digitalWrite(13,LOW);
return;
}

if ((value / 8) >= 1) {

What is the answer to the equation: value divided by smiley face? There is another reason to post code in code tags as requested in tne forum guidelines.

Welcome

I think this may be useful for you : Led binary counter for xmas ! Help me! - #7 by guix - LEDs and Multiplexing - Arduino Forum