From 4ad03f83981f3df5bbdc555593969203a19f0b11 Mon Sep 17 00:00:00 2001 From: PhyxtGEARS Date: Sat, 1 Apr 2017 13:35:26 -0400 Subject: [PATCH] Added shooting to sequence Now shoots three times in a row Added to main sequence random BLUE or RED Run_Bling.ino --> _Run_Bling.ino --- Images_and_Text.ino | 14 +++++++++++++- PhyXTGears-2017-Bling.ino | 18 +++++++----------- Run_Bling.ino => _Run_Bling.ino | 9 +++++++++ 3 files changed, 29 insertions(+), 12 deletions(-) rename Run_Bling.ino => _Run_Bling.ino (94%) diff --git a/Images_and_Text.ino b/Images_and_Text.ino index b02338d..3d1101a 100644 --- a/Images_and_Text.ino +++ b/Images_and_Text.ino @@ -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; @@ -150,7 +160,6 @@ void ballShoot (uint16_t rCol) { matrix.clear(); // delay(250); } - delay(750); // (-((xF/7.6)-3.3)^2 + 15) } @@ -161,6 +170,9 @@ void robotMove (uint16_t rCol) { updateScreen(); matrix.clear(); delay(70); + if (i == 17) { + delay(150); + } } } diff --git a/PhyXTGears-2017-Bling.ino b/PhyXTGears-2017-Bling.ino index 3edfc48..10faa71 100644 --- a/PhyXTGears-2017-Bling.ino +++ b/PhyXTGears-2017-Bling.ino @@ -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 @@ -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 @@ -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); } diff --git a/Run_Bling.ino b/_Run_Bling.ino similarity index 94% rename from Run_Bling.ino rename to _Run_Bling.ino index 648463a..ef97beb 100644 --- a/Run_Bling.ino +++ b/_Run_Bling.ino @@ -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: @@ -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();