I'm trying to make a range blink, modifying digital hourglass.

I am working through the Arduino project book and I am on project 8, digital hourglass. I am really trying to make the jump from copying code to writing code. So I took the program that counted every 10 minutes and turned on an LED until you reset it with a turn of the wrist, and changed it to a 5 minute delay and with 12 LED’s. What I then tried to do was to get the LED’s to blink once they were all lit, what I really want to do but I’m just not there yet is make all the LED’s blink randomly when the hour is up. So for now I just need to figure out how to get the LED’s to blink. I set a range, included all the pins that had an LED attached then tried to turn them off then on then off. I tried to keep it simple but it did not compile. What am I forgetting and how am I messing it up? Do I need to have another line of code that defines what the range is? The program is attached below.

Here are the error codes:
Arduino: 1.7.10 (Mac OS X), Board: “Arduino Uno”

sketch_oct11a.ino: In function ‘void loop()’:
sketch_oct11a.ino:52:27: error: invalid conversion from ‘int*’ to ‘uint8_t {aka unsigned char}’ [-fpermissive]
In file included from sketch_oct11a.ino:2:0:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:126:6: error: initializing argument 1 of ‘void digitalWrite(uint8_t, uint8_t)’ [-fpermissive]
void digitalWrite(uint8_t, uint8_t);
^
sketch_oct11a.ino:54:28: error: invalid conversion from ‘int*’ to ‘uint8_t {aka unsigned char}’ [-fpermissive]
In file included from sketch_oct11a.ino:2:0:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:126:6: error: initializing argument 1 of ‘void digitalWrite(uint8_t, uint8_t)’ [-fpermissive]
void digitalWrite(uint8_t, uint8_t);
^
sketch_oct11a.ino:56:27: error: invalid conversion from ‘int*’ to ‘uint8_t {aka unsigned char}’ [-fpermissive]
In file included from sketch_oct11a.ino:2:0:
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h:126:6: error: initializing argument 1 of ‘void digitalWrite(uint8_t, uint8_t)’ [-fpermissive]
void digitalWrite(uint8_t, uint8_t);
^
Error compiling.

sketch_oct11a.ino (865 Bytes)

	uint8_t ledPins[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };

	digitalWrite(ledPins, LOW);		// you need to pass an entry in the array ...
	delay(1000UL);

	digitalWrite(ledPins, HIGH);	// ... NOT ...
	delay(1000UL);

	digitalWrite(ledPins, LOW);		// ... whole array

I shaky on what you mean when you say "pass an entry". I want the array to turn off, do i need to list all 12 LED's one at a time? Thanks for the reply!

mfettinger:
I shaky on what you mean when you say "pass an entry". I want the array to turn off, do i need to list all 12 LED's one at a time? Thanks for the reply!

Yes you do. digitalWrite takes a single PIN number as the first argument, not an array.

Use a for loop to go through your array and toggle each pin.

Ok, I've done some of those, I'll look back at my sketches and see if I can find the right stuff to make a go of it.
Thanks

Well I got the LED’s to blink! They just don’t wait until the end to do it. I think I’m missing one thing but I can’t put my finger on what is it.

Blinking.ino (924 Bytes)