/*
Adafruit Arduino - Lesson 4. 8 LEDs and a Shift Register
*/
int latchPin = 5;
int clockPin = 6;
int dataPin = 4;
byte leds = 1;
void setup()
{
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
}
void loop()
{
leds = 1;
updateShiftRegister();
delay(500);
for (int i = 0; i < 8; i++)
{
bitSet(leds, 1);
updateShiftRegister();
delay(500);
}
}
void updateShiftRegister()
{
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, LSBFIRST, leds);
digitalWrite(latchPin, HIGH);
}
as soon as I attempt to remove the loop "for (int i = 0; i < 8; i++)
{" is says that "updateShiftRegister(); was not declared in this scope. It's winding me up, it's probably something I'm missing and simple but I just don't know