control LED and for loop question

Hello,
I want to turn on LED and read analog voltage from each LED states.
I think there is a problem with red part of code.
what is the problem?

const int analogPin= A0;
float voltage[] = {0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 ,0.00, 0.00, 0.00, 0.00};
float voltageMin = 2.00;

void setup() {

Serial.begin(9600);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
}

void loop(){

int number=0;
int i,j,t;

for(;number<=15;number++)
{
int num[]={0,0,0,0};
t=number;

for(i=0;i<=3;i++){
num*=t%2;*

  • t=t/2;*
  • }*
  • digitalWrite(4,num[3]);*
  • digitalWrite(5,num[2]);*
  • digitalWrite(2,num[1]);*
  • digitalWrite(3,num[0]);*
  • delay(5000);*

_ voltage[number] = analogRead(analogPin) * (5.00 / 1023.00);_

  • Serial.println(voltage[number]);*

  • if(voltage[number] < voltageMin){*

  • voltageMin = voltage[number];*

  • }*

  • return;*

  • }*

  • Serial.println(voltageMin);Serial.println(voltageMin);*

}

Several compile errors:

num=t%2;

You've defined num to be an array, so there needs to be an index in brackets (e.g., num[val]). An array name by itself is where it is stored in memory (i.e., its lvalue), so trying to assign it a new memory address will make the compiler a bit cranky.

The statement:

voltage[number] = analogRead(analogPin) * (5.00 / 1023.00);

is also going to make the compiler unhappy. Where is voltage defined? Where is analogPin defined? Where is voltageMin defined? You need to define these at the appropriate scope level before you use them.