Loading
Loading
IoT Lab content is currently available in Arabic only. We're working on an English version.
عرض بالعربية →Control 8 LEDs using only 3 Arduino pins.
Requires close attention: Data Pin to 11, Latch Pin to 8, Clock Pin to 12.
const int latchPin = 8;
const int clockPin = 12;
const int dataPin = 11;
void setup() {
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
}
void loop() {
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, 0b10101010); // إضاءة تبادلية
digitalWrite(latchPin, HIGH);
delay(1000);
}Forgetting to connect the MR and OE pins on the chip — MR to 5V and OE to GND for the chip to work as expected.