Hi there!
I'm new to arduino stuff and I'm still learning.
I had some experience programming ( Pascal, Visual Basic and C), at the moment i'm trying to make every led in a 10 LED Strip blink, and with the last LED blinks, perform the same action backwords ( from the last LED to the first).
I tried the following code but it aint working (it compiles, tested with 3 LEDs first):
It only lights one of the LEDs and it doesn't blink.
I'm using the wrong arduino ports? (Arduino DUE)
If the code is ok, guess there something wrong with the circuit.
(Edit by moderator to use CODE and /CODE tags and fix indentation -- KrisBlueNZ)
I'm new to arduino stuff and I'm still learning.
I had some experience programming ( Pascal, Visual Basic and C), at the moment i'm trying to make every led in a 10 LED Strip blink, and with the last LED blinks, perform the same action backwords ( from the last LED to the first).
I tried the following code but it aint working (it compiles, tested with 3 LEDs first):
Code:
int nPin;
void setup()
{
// put your setup code here, to run once:
for (nPin=31; nPin = 33; nPin++)
{
pinMode(nPin,OUTPUT);
}
}
void loop()
{
// Acende os LED's sequecialmente até a porta 10
for (nPin=31; nPin=33; nPin++)
{
digitalWrite(nPin, HIGH);
delay(250);
digitalWrite(nPin, LOW);
}
// Acende os LED's sequencialmente até a porta 1
for (nPin=33; nPin=31; nPin--)
{
digitalWrite(nPin, HIGH);
delay(250);
digitalWrite(nPin, LOW);
}
}
It only lights one of the LEDs and it doesn't blink.
I'm using the wrong arduino ports? (Arduino DUE)
If the code is ok, guess there something wrong with the circuit.
(Edit by moderator to use CODE and /CODE tags and fix indentation -- KrisBlueNZ)
Last edited by a moderator: