Arduino with 10 times CNY70 sensors

robtillaart:
because you worked so hard :wink:

//

//    FILE: .pde
//  AUTHOR: Stefan
//    DATE: 
//
// PUPROSE:
//

int PIN[12];

int sensorValue[10];

void setup()
{
  for (uint8_t i=0; i< 10; i++)
  {
    PIN[i] = i+1;
  } 
  for (uint8_t i=0; i< 10; i++)
  {
    pinMode(PIN[i], INPUT);
  }
  Serial.begin(115200);
}

void loop()
{
  for (uint8_t i=0; i< 10; i++)
  {
    sensorValue[i] = digitalRead(PIN[i]);
  }

for (uint8_t i=0; i< 10; i++)
  {
    Serial.print("D");
    Serial.print(PIN[i]);
    Serial.print(": \t");
    Serial.println(sensorValue[i]);
  } 
  delay (1500);
}




Rob
PS, if English is not your native language you better set it in your profile than other people will understand it directly, 
By the way your English is not bad, visit the forum often and you will learn more than only Arduinese ;)

Thank You very much!
This is exactly what i ment.
and thanks for the tip btw;)