Language Structure

Please help me understand the following line of code:

void digital_1(void) //Display number 1

the word void in both cases is blue, what does this command mean?

The void on the left means that the function does not return a value. The void on the right means that there are no arguments for the function to act upon.

The void on the right is optional. The parenthesis are required but may be empty. The void on the left is required when the function returns nothing.

Arduino functions

groundFungus:
The void on the right is optional. The parenthesis are required but may be empty. The void on the left is required when the function returns nothing.

The missing ';' at the end is mandatory.

It is not exactly clear, to me, if that is a function declaration (; required) or the start of a function definition ({ //body; } required).

I still do not understand, in laymens terms, what does this line of code actually do?

It means you're formally introducing a function called "digital_1" that takes no parameters, and returns no value.

Okay, i get that, now what exactly does " function called "digital_1" do?

kenmustunis:
Okay, i get that, now what exactly does " function called "digital_1" do?

We don't know, because you've introduced us, but not shown us it.

Hope this helps. Here is the last few lines of code:

void digital_F(void) //Display F // Question applies here, this line
{
unsigned char j;
digitalWrite(a,HIGH);
digitalWrite(b,LOW);
digitalWrite(c,LOW);
digitalWrite(d,LOW);
digitalWrite(e,HIGH);
digitalWrite(f,HIGH);
digitalWrite(g,HIGH);
digitalWrite(dp,HIGH);
}

void setup()
{
int i;//defined variable
for(i=4;i<=11;i++) //Set pinMode to all outputs in one step for all pins
pinMode(i,OUTPUT);//Set the 4 thru 11 pins for the output mode
}
void loop()
{
while(1)
{
digital_0();//Display number 0
delay(1000);//delay 1s
digital_1();//Display number 1
delay(1000);//delay 1s
digital_2();//Display number 2
delay(1000); //delay 1s
digital_3();//Display number 3
delay(1000); //delay 1s
digital_4();//Display number 4
delay(1000); //delay 1s
digital_5();//Display number 5
delay(1000); //delay 1s
digital_6();//Display number 6
delay(1000); //delay 1s
digital_7();//Display number 7
delay(1000); //delay 1s
digital_8();//Display number 8
delay(1000); //delay 1s
digital_9();//Display number 9
delay(1000); //delay 1s
digital_A();//Display Letter A
delay(1000); //delay 1s
digital_b();//Display Letter b
delay(1000); //delay 1s
digital_C();//Display Letter C
delay(1000); //delay 1s
digital_d();//Display Letter d
delay(1000); //delay 1s
digital_E();//Display Letter E
delay(1000); //delay 1s
digital_F();//Display Letter F
delay(1000); //delay 1s

}
}

Hope this helps.

No, not really.
We don't know what a,b,c,d,e,f,g or dp are, nor why j isn't used.
(It's a seven segment display, but that's an educated guess)

Please remember to use code tags when posting code.

Whoever wrote that code does not seem to know that loop() loops.

kenmustunis:
Okay, i get that, now what exactly does " function called "digital_1" do?

With all those delays in it it wastes a lot of time.

As far as the delays are concerned, this program is being used primarily to check the operation of our 7 segment displays returned to us as "Defective". The a, b, c, d, e, f, g, are the actual segment displays and the dp is decimal point readout. to this response:Whoever wrote that code does not seem to know that loop() loops. I didn't write the code, I got it from a kit. This is what I'm trying to figure out what that line is doing...

This is what I'm trying to figure out what that line is doing.

If you re-read the previous posts, perhaps the provided explanations will become clear.

kenmustunis:
Hope this helps. Here is the last few lines of code:

void digital_F(void) //Display F // Question applies here, this line
{
unsigned char j;
digitalWrite(a,HIGH);
digitalWrite(b,LOW);
digitalWrite(c,LOW);
digitalWrite(d,LOW);
digitalWrite(e,HIGH);
digitalWrite(f,HIGH);
digitalWrite(g,HIGH);
digitalWrite(dp,HIGH);
}

Here's the function cleaned up a bit:

void digital_F();   //Display F
{
  digitalWrite(a, HIGH);
  digitalWrite(b, LOW);
  digitalWrite(c, LOW);
  digitalWrite(d, LOW);
  digitalWrite(e, HIGH);
  digitalWrite(f, HIGH);
  digitalWrite(g, HIGH);
  digitalWrite(dp, HIGH);
}

From the others' comments, when this function is called, the segments making up the letter 'F' are lit.
The "unsigned char j;" in the function does absolutely nothing.

The code would not compile without the semicolon on the first line of the function.
Also, in the IDE, use CTRL-T to format the appearance of the code.

If you are just testing the display, you don't need to cycle through the alphabet. Just light the segments one at a time, then all segments. If one segment fails to light, then the display is bad.

The code would not compile without the semicolon on the first line of the function

Then something else is wrong with whatever you tried to compile, because that semicolon is wrong.

Post the complete code.

T0: SteveMann your post helped sum it up. Thank you!!

jremington:
Then something else is wrong with whatever you tried to compile, because that semicolon is wrong.

Post the complete code.

Wow, how did I miss that?