6 edited tags
| link
5 Fixed grammar and formatting
source | link

i'veI've used the following code to light 8 yellow leds sequentially but it only runs as it's supposed to be on proteus howeverProteus. However in my breadboard the 8 leds keeps blinking all together,the the resistors used are 220 ohm..ohms. alsoAlso when i'm trying to change the value of the variable "leds" to be for example 0x0F0x0F, it doesn't light, i'veI've read in the arduinoArduino shiftout tutorial that 0.1F capacitor on the latch pin will even the flickers so now i'mI'm really confused.

`intint latchPin = 8;
int clockPin = 12;
int dataPin = 11;

byte leds = 0;

void setup() 
{
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clockPin, OUTPUT);
}

void loop() 
{
  leds = 0;
  updateShiftRegister();
  delay(500);
  for (int i = 0; i < 8; i++)
  {
    bitSet(leds, i);
    updateShiftRegister();
    delay(100);
  }
}

void updateShiftRegister()
{
   digitalWrite(latchPin, LOW);
   shiftOut(dataPin, clockPin, LSBFIRST, leds);
   digitalWrite(latchPin, HIGH);

}```
[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/DAjY6.png

enter image description here

i've used the following code to light 8 yellow leds sequentially but it only runs as it's supposed to be on proteus however in my breadboard the 8 leds keeps blinking all together,the resistors used are 220 ohm... also when i'm trying to change the value of the variable "leds" to be for example 0x0F, it doesn't light, i've read in the arduino shiftout tutorial that 0.1F capacitor on the latch pin will even the flickers so now i'm really confused.

`int latchPin = 8;
int clockPin = 12;
int dataPin = 11;

byte leds = 0;

void setup() 
{
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clockPin, OUTPUT);
}

void loop() 
{
  leds = 0;
  updateShiftRegister();
  delay(500);
  for (int i = 0; i < 8; i++)
  {
    bitSet(leds, i);
    updateShiftRegister();
    delay(100);
  }
}

void updateShiftRegister()
{
   digitalWrite(latchPin, LOW);
   shiftOut(dataPin, clockPin, LSBFIRST, leds);
   digitalWrite(latchPin, HIGH);

}```
[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/DAjY6.png

I've used the following code to light 8 yellow leds sequentially but it only runs as it's supposed to be on Proteus. However in my breadboard the 8 leds keeps blinking all together, the resistors used are 220 ohms. Also when i'm trying to change the value of the variable "leds" to be for example 0x0F, it doesn't light, I've read in the Arduino shiftout tutorial that 0.1F capacitor on the latch pin will even the flickers so now I'm really confused.

int latchPin = 8;
int clockPin = 12;
int dataPin = 11;

byte leds = 0;

void setup() 
{
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clockPin, OUTPUT);
}

void loop() 
{
  leds = 0;
  updateShiftRegister();
  delay(500);
  for (int i = 0; i < 8; i++)
  {
    bitSet(leds, i);
    updateShiftRegister();
    delay(100);
  }
}

void updateShiftRegister()
{
   digitalWrite(latchPin, LOW);
   shiftOut(dataPin, clockPin, LSBFIRST, leds);
   digitalWrite(latchPin, HIGH);

}

enter image description here

4 edited body
source | link

i've used the following code to light 8 yellow leds sequentially but it only runs as it's supposed to be on proteus however in my breadboard the 8 leds keeps blinking all together,the resistors used are 220 ohm... also when i'm trying to change the value of the variable "leds" to be for example 0x0F, it doesn't light, i've read in the arduino shiftout tutorial that 0.1F capacitor on the latch pin will even the flickers so now i'm really confused.

`int latchPin = 8;
int clockPin = 12;
int dataPin = 11;

byte leds = 0;

void setup() 
{
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clockPin, OUTPUT);
}

void loop() 
{
  leds = 0;
  updateShiftRegister();
  delay(500);
  for (int i = 0; i < 8; i++)
  {
    bitSet(leds, i);
    updateShiftRegister();
    delay(100);
  }
}

void updateShiftRegister()
{
   digitalWrite(latchPin, LOW);
   shiftOut(dataPin, clockPin, LSBFIRST, leds);
   digitalWrite(latchPin, HIGH);

}```
[![enter image description here][1]][1]`here][1]][1]


  [1]: https://i.stack.imgur.com/zDqBZDAjY6.png

i've used the following code to light 8 yellow leds sequentially but it only runs as it's supposed to be on proteus however in my breadboard the 8 leds keeps blinking all together,the resistors used are 220 ohm... also when i'm trying to change the value of the variable "leds" to be for example 0x0F, it doesn't light, i've read in the arduino shiftout tutorial that 0.1F capacitor on the latch pin will even the flickers so now i'm really confused.

`int latchPin = 8;
int clockPin = 12;
int dataPin = 11;

byte leds = 0;

void setup() 
{
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clockPin, OUTPUT);
}

void loop() 
{
  leds = 0;
  updateShiftRegister();
  delay(500);
  for (int i = 0; i < 8; i++)
  {
    bitSet(leds, i);
    updateShiftRegister();
    delay(100);
  }
}

void updateShiftRegister()
{
   digitalWrite(latchPin, LOW);
   shiftOut(dataPin, clockPin, LSBFIRST, leds);
   digitalWrite(latchPin, HIGH);

}```
[![enter image description here][1]][1]`


  [1]: https://i.stack.imgur.com/zDqBZ.png

i've used the following code to light 8 yellow leds sequentially but it only runs as it's supposed to be on proteus however in my breadboard the 8 leds keeps blinking all together,the resistors used are 220 ohm... also when i'm trying to change the value of the variable "leds" to be for example 0x0F, it doesn't light, i've read in the arduino shiftout tutorial that 0.1F capacitor on the latch pin will even the flickers so now i'm really confused.

`int latchPin = 8;
int clockPin = 12;
int dataPin = 11;

byte leds = 0;

void setup() 
{
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clockPin, OUTPUT);
}

void loop() 
{
  leds = 0;
  updateShiftRegister();
  delay(500);
  for (int i = 0; i < 8; i++)
  {
    bitSet(leds, i);
    updateShiftRegister();
    delay(100);
  }
}

void updateShiftRegister()
{
   digitalWrite(latchPin, LOW);
   shiftOut(dataPin, clockPin, LSBFIRST, leds);
   digitalWrite(latchPin, HIGH);

}```
[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/DAjY6.png
3 edited body
source | link
2 edited body
source | link
1
source | link