[ create a new paste ] login | about

Link: http://codepad.org/yNU3gHCC    [ raw code | output | fork ]

C, pasted on Feb 8:
const int numLed = 6;
const int ledPin[] = {8, 9, 10, 11, 12, 13}; // welche Ausgänge sind belegt
int zeit = 500;

void setup() {
  
  for(int i=0; i<numLed; i++) 
  {
    pinMode(ledPin[i], OUTPUT);
  }

}

void loop() {
  
  for(int i=0; i<numLed; i++)
  {
    digitalWrite(ledPin[i], LOW);
  }

  for(int i=0; i<numLed; i++)
  {
    digitalWrite(ledPin[i], HIGH);
    delay(zeit);
  }

}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
In function 'setup':
Line 7: error: 'for' loop initial declaration used outside C99 mode
Line 9: error: 'OUTPUT' undeclared (first use in this function)
Line 9: error: (Each undeclared identifier is reported only once
Line 9: error: for each function it appears in.)
In function 'loop':
Line 16: error: 'for' loop initial declaration used outside C99 mode
Line 18: error: 'LOW' undeclared (first use in this function)
Line 21: error: redefinition of 'i'
Line 16: error: previous definition of 'i' was here
Line 21: error: 'for' loop initial declaration used outside C99 mode
Line 23: error: 'HIGH' undeclared (first use in this function)


Create a new paste based on this one


Comments: