Modified changeAllColors, added spacing
This commit is contained in:
parent
369ecd14db
commit
d13d565c73
24
main.c
24
main.c
@ -1,14 +1,14 @@
|
|||||||
#include <wiringPi.h>
|
#include <wiringPi.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#define LATCH_PIN 2
|
#define LATCH_PIN 2
|
||||||
#define CLOCK_PIN 0
|
#define CLOCK_PIN 0
|
||||||
#define DATA_PIN 3
|
#define DATA_PIN 3
|
||||||
#define OFF false, false, false
|
#define OFF false, false, false
|
||||||
#define RED true, false, false
|
#define RED true, false, false
|
||||||
#define GREEN false, true, false
|
#define GREEN false, true, false
|
||||||
#define BLUE false, false, true
|
#define BLUE false, false, true
|
||||||
#define PURPLE true, false, true
|
#define PURPLE true, false, true
|
||||||
typedef enum { LEFT, RIGHT } Side_t;
|
typedef enum { LEFT, RIGHT } Side_t;
|
||||||
bool colorField[] = {
|
bool colorField[] = {
|
||||||
false, // Left red
|
false, // Left red
|
||||||
@ -50,12 +50,8 @@ void changeColor(Side_t side, bool red, bool green, bool blue) {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
void changeAllColors(bool red, bool green, bool blue) {
|
void changeAllColors(bool red, bool green, bool blue) {
|
||||||
colorField[0] = red;
|
changeColor(LEFT, red, green, blue);
|
||||||
colorField[1] = green;
|
changeColor(RIGHT, red, green, blue);
|
||||||
colorField[2] = blue;
|
|
||||||
colorField[3] = red;
|
|
||||||
colorField[4] = green;
|
|
||||||
colorField[5] = blue;
|
|
||||||
}
|
}
|
||||||
int main(void) {
|
int main(void) {
|
||||||
wiringPiSetup();
|
wiringPiSetup();
|
||||||
|
Loading…
Reference in New Issue
Block a user