Hello Everyone!! im novice in arduino i really need ur help..
i have 2 digital input pins(pin16 & pin17 actually i need 4)
just to test if it really gonna work.What i did is that
i just give 5volts or high to these pins as input data
but what happened there is that the 2 digitalOutput pins respectively
seems doesnt do to the conditions i gave, it seems it can affect the other condition..
Here is my code...
int sPin =16;
int sPin1 =17;
int ledPin7 =7;
int ledPin6 =6;
void setup(){
Serial.begin(9600);
pinMode(ledPin7,OUTPUT);
pinMode(ledPin6,OUTPUT);
pinMode(sPin,INPUT);
pinMode(sPin1,INPUT);
Serial.begin(9600);
}
void loop(){
Serial.println(digitalRead(sPin));
delay(500);
int val = digitalRead(sPin);
if (digitalRead(sPin) == LOW )
{ digitalWrite(ledPin7,HIGH);
}
if (digitalRead(sPin1) == LOW )
{ digitalWrite(ledPin6,HIGH);
}
else
digitalWrite(ledPin7,LOW);
digitalWrite(ledPin6,LOW);
}
what i really want to do there is that,
just have 4 inputs(that would be 5volts/0)
and also give 4 outputs respectively..
i really need ur ideas, suggestions or any other alternatives guyz.. thnx