Help with changing a parameter into seven segment display numbers.

I am quite new to programming, and I need help with creating this very simple project.
It would output a series of binary numbers to my seven segment display. I already have functions for all the numbers on my display, but I cannot think of a way to make the display activate my seven segment number functions. I do not fully understand how to use strings, as there is no string clear string variable that there is in other languages.
I realise that you might be able to do this with arrays, but I cannot think how, please explain :slight_smile:

**What I mean is how do I easily make the functions read if the parameter given is a 0 or 1,without adding loads more parameters or having to change the number I put in. ** - sorry for nooby question and thanks :stuck_out_tongue:

 void SevSegBinary(int binary){
 //I do not understand how to do the stuff here
   }

and in the loop

SevSegBinary(010100110100111101010011);

the functions I created for seven segment display are one(), two() three() and so on.

SevSegBinary(010100110100111101010011);

That’s a mighty big octal number - what does it represent?

It represents every number which I would like the seven segment to output. It is SOS in binary :stuck_out_tongue:

It is SOS in binary

No, it's a very big number in octal.

I thought it was binary, now I am confused

The compiler isn't confused.
Why don't you post your code?

That is my code, I am looking for a method that will enable me to see if the number is a 0 or a 1 and then output it to my seven segment display. I have no error because there is nothing to fault

I can’t see any code.

What do you mean? I am asking for somebody to help me with the function that I put in my main post.

Which function?
I can't see any function.

Is this not a function? if not then I am very sorry
I don't know what to but in here

void SevSegBinary(int binary){
 //I do not understand how to do the stuff here
   }

It would output a series of binary numbers to my seven segment display. I already have functions for all the numbers on my display, but I cannot think of a way to make the display activate my seven segment number functions.

Without seeing these functions, it's going to be impossible to do anything.

if you insist...

void one(){
   digitalWrite(2, 0);
   digitalWrite(3, 0);  
   digitalWrite(4, 1);
   digitalWrite(5, 0);
   digitalWrite(6, 0);
   digitalWrite(7, 0);
   digitalWrite(8, 0);
   digitalWrite(9, 1);
 }
 void two(){
   digitalWrite(2, 1);
   digitalWrite(3, 1);  
   digitalWrite(4, 0);
   digitalWrite(5, 0);
   digitalWrite(6, 1);
   digitalWrite(7, 0);
   digitalWrite(8, 1);
   digitalWrite(9, 1);
 }
  void three(){
   digitalWrite(2, 0);
   digitalWrite(3, 1);  
   digitalWrite(4, 1);
   digitalWrite(5, 0);
   digitalWrite(6, 1);
   digitalWrite(7, 0);
   digitalWrite(8, 1);
   digitalWrite(9, 1);
 }
  void four(){
   digitalWrite(2, 0);
   digitalWrite(3, 0);  
   digitalWrite(4, 1);
   digitalWrite(5, 0);
   digitalWrite(6, 1);
   digitalWrite(7, 1);
   digitalWrite(8, 0);
   digitalWrite(9, 1);
 }
   void five(){
   digitalWrite(2, 0);
   digitalWrite(3, 1);  
   digitalWrite(4, 1);
   digitalWrite(5, 0);
   digitalWrite(6, 1);
   digitalWrite(7, 1);
   digitalWrite(8, 1);
   digitalWrite(9, 0);
 }
   void six(){
   digitalWrite(2, 1);
   digitalWrite(3, 1);  
   digitalWrite(4, 1);
   digitalWrite(5, 0);
   digitalWrite(6, 1);
   digitalWrite(7, 1);
   digitalWrite(8, 1);
   digitalWrite(9, 0);
 }
   void seven(){
   digitalWrite(2, 0);
   digitalWrite(3, 0);  
   digitalWrite(4, 1);
   digitalWrite(5, 0);
   digitalWrite(6, 0);
   digitalWrite(7, 0);
   digitalWrite(8, 1);
   digitalWrite(9, 1);
 }
   void eight(){
   digitalWrite(2, 1);
   digitalWrite(3, 1);  
   digitalWrite(4, 1);
   digitalWrite(5, 0);
   digitalWrite(6, 1);
   digitalWrite(7, 1);
   digitalWrite(8, 1);
   digitalWrite(9, 1);
 }
   void nine(){
   digitalWrite(2, 0);
   digitalWrite(3, 1);  
   digitalWrite(4, 1);
   digitalWrite(5, 0);
   digitalWrite(6, 1);
   digitalWrite(7, 1);
   digitalWrite(8, 1);
   digitalWrite(9, 1);
 }
   void zero(){
   digitalWrite(2, 1);
   digitalWrite(3, 1);  
   digitalWrite(4, 1);
   digitalWrite(5, 0);
   digitalWrite(6, 0);
   digitalWrite(7, 1);
   digitalWrite(8, 1);
   digitalWrite(9, 1);
 }

I mean it should activate zero or one when 0 or 1 are in the parameter
so 10011 would go like this
one();
zero();
zero();
one();
one();
But I would like to do this without calling fifteen functions, so hence a made a function with a parameter, but I do not know what to put in it
I have to go now, Please can you figure put what I mean while I am gone?

A table of function pointers seems to me to be the simplest way.
Just make sure you understand the difference between octal and other number base representations.