From d13d565c731b6fc629ea9e9953de82f06108f1fa Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Tue, 3 Jan 2017 16:56:12 +0000 Subject: [PATCH] Modified changeAllColors, added spacing --- main.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/main.c b/main.c index 0163fd5..d7b2e10 100644 --- a/main.c +++ b/main.c @@ -1,14 +1,14 @@ #include #include #include -#define LATCH_PIN 2 -#define CLOCK_PIN 0 -#define DATA_PIN 3 -#define OFF false, false, false -#define RED true, false, false -#define GREEN false, true, false -#define BLUE false, false, true -#define PURPLE true, false, true +#define LATCH_PIN 2 +#define CLOCK_PIN 0 +#define DATA_PIN 3 +#define OFF false, false, false +#define RED true, false, false +#define GREEN false, true, false +#define BLUE false, false, true +#define PURPLE true, false, true typedef enum { LEFT, RIGHT } Side_t; bool colorField[] = { false, // Left red @@ -50,12 +50,8 @@ void changeColor(Side_t side, bool red, bool green, bool blue) { delay(1000); } void changeAllColors(bool red, bool green, bool blue) { - colorField[0] = red; - colorField[1] = green; - colorField[2] = blue; - colorField[3] = red; - colorField[4] = green; - colorField[5] = blue; + changeColor(LEFT, red, green, blue); + changeColor(RIGHT, red, green, blue); } int main(void) { wiringPiSetup();