Digital Input configuration - am I just too tired today?

So…I’m getting frustrated over the most elementary thing-- setting pins to be digital inputs. I had no problem with my analog inputs. What???

Here’s my code:

int di1 = D0;
int di2 = D1;
int di3 = D2;
int di4 = D3;
int di5 = D4; 
int di6 = D5;

pinMode(di1,INPUT);
pinMode(di2,INPUT);
pinMode(di3,INPUT);
pinMode(di4,INPUT); 
pinMode(di5,INPUT);
pinMode(di6,INPUT);

I’m getting an error on each of the pinMode lines. The error reads "expected constructor, destructor, or type conversion before “(” token. This occurs even if I put “D0” in place of “di1” in the pinMode() call.

Geez, I hate to post something so simple.

@ctmorrison, the pinMode() statements need to be in you setup() or loop() functions :wink:

duh…

1 Like