Skip to content

Commit

Permalink
Added shooting to sequence
Browse files Browse the repository at this point in the history
Now shoots three times in a row
Added to main sequence
	random BLUE or RED
Run_Bling.ino --> _Run_Bling.ino
  • Loading branch information
PhyXTGears-1720 committed Apr 1, 2017
1 parent 6ba4eec commit 4ad03f8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
14 changes: 13 additions & 1 deletion Images_and_Text.ino
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ void credits (String messages[], uint16_t colors[], int LoopSize, int Delay, int
delay(Delay + 250);
}

void ball (uint16_t rCol) {
robotMove(rCol);
for (int i = 0; i < 3; i++) {
delay(random(500));
ballShoot(rCol);
}
updateScreen();
delay(500);
}

void ballShoot (uint16_t rCol) {
for (float xF = 0; xF < 40; xF++) {
double yF = ((xF - 2) / 6.3) - 3.3;
Expand All @@ -150,7 +160,6 @@ void ballShoot (uint16_t rCol) {
matrix.clear();
// delay(250);
}
delay(750);
// (-((xF/7.6)-3.3)^2 + 15)
}

Expand All @@ -161,6 +170,9 @@ void robotMove (uint16_t rCol) {
updateScreen();
matrix.clear();
delay(70);
if (i == 17) {
delay(150);
}
}
}

18 changes: 7 additions & 11 deletions PhyXTGears-2017-Bling.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#define HEIGHT 8 // each
#define NUMBER 2 // number of panels

#define PROGS 14 // programs that exist
#define ToRUN 12 // # to run (if oneOfEach is false) (if true, must equal number of progams being run)
#define PROGS 15 // programs that exist
#define ToRUN 11 // # to run (if oneOfEach is false) (if true, must equal number of progams being run)
const bool oneOfEach = true;

#define OVER true
Expand Down Expand Up @@ -91,11 +91,13 @@ int firstLogoW;
10: 1720
11: Honors
12: Thank you 447 for lunch
13: Team # display
14: Ball shooting
*/

// // one of each true (false)
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
int progLimit[PROGS] = {1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 2}; // Limit for each program (or ratio)
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
int progLimit[PROGS] = {1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1}; // Limit for each program (or ratio)
int progRuns[PROGS]; // Number of times each has been selected (nothing)
int blingPrograms[ToRUN]; // order

Expand Down Expand Up @@ -218,11 +220,5 @@ void test () {

// brightOver(255);
// matrix.fillCircle(20, 8, 1.5f, matrix.Color(200, 230, 0));
robotMove(BLUE);
for (int i = 0; i < 5; i++) {
ballShoot(BLUE);
delay(ceil(random(5000) / 10.0));
}
updateScreen();
delay(500);
ball(RED);
}
9 changes: 9 additions & 0 deletions Run_Bling.ino → _Run_Bling.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ void runBling (int order[]) {
String tN[] = {"71", "1529", "1720"};
uint16_t tC[] = {matrix.Color(0, 0, 128), matrix.Color(255, 0, 0), matrix.Color(0, 255, 0)};
for (int i = 0; i < n; i++) {
int bCo = random(2);
Serial.println("Running #" + String(i + 1) + ": " + String(blingPrograms[i]));
switch (blingPrograms[i]) {
case 0:
Expand Down Expand Up @@ -84,6 +85,14 @@ void runBling (int order[]) {
credits (tN, tC, 2);
Reset();
break;
case 14:
if (bCo == 0) {
ball(RED);
} else {
ball(BLUE);
}
Reset();
break;
}
Serial.print("d");
Reset();
Expand Down

0 comments on commit 4ad03f8

Please sign in to comment.