/// <summary> /// ***************************************************************** /// * Talent Show > Mixing it Up * /// ***************************************************************** /// </summary> /// <param name="finchRobot">finch robot object</param> static void DisplayMixingItUp(Finch finchRobot) { Console.CursorVisible = false; DisplayScreenHeader("Mixing it up"); Console.WriteLine("\tThe Finch robot will now move in a square pattern while flashing lights and making noise!"); DisplayContinuePrompt(); for (int t = 0; t < 4; t++) { finchRobot.setMotors(80, 100); for (int lightSoundLevel = 0; lightSoundLevel < 100; lightSoundLevel++) { finchRobot.setLED(0, lightSoundLevel, lightSoundLevel); finchRobot.noteOn(lightSoundLevel * 50); } finchRobot.setMotors(0, 100); for (int lightSoundLevel = 100; lightSoundLevel > 0; lightSoundLevel--) { finchRobot.setLED(lightSoundLevel, lightSoundLevel, lightSoundLevel); finchRobot.noteOn(lightSoundLevel * 50); } finchRobot.setMotors(0, 0); } finchRobot.setLED(0, 0, 0); finchRobot.noteOn(0); DisplayMenuPrompt("Talent Show Menu"); }
/// <summary> /// Plays the last few notes of Imperial March. WARNING: LONG CODE BLOCK! /// </summary> /// <param name="myFinch"></param> public static void PlayGameOverMarch(Finch myFinch) { // Just the last five notes: myFinch.noteOn(349); myFinch.wait(250); myFinch.noteOff(); myFinch.wait(10); myFinch.noteOn(415); myFinch.wait(500); myFinch.noteOff(); myFinch.wait(10); myFinch.noteOn(349); myFinch.wait(375); myFinch.noteOff(); myFinch.wait(10); myFinch.noteOn(261); myFinch.wait(125); myFinch.noteOff(); myFinch.wait(10); myFinch.noteOn(475); myFinch.wait(1000); myFinch.noteOff(); myFinch.wait(100); }
static bool SentryVersusThresholdValue(double lowerTempThreshold, Finch finch, double upperLightThreshold) { if (finch.getTemperature() <= lowerTempThreshold) { for (int i = 0; i < 5; i++) { finch.noteOn(600); finch.wait(50); finch.noteOff(); } Console.WriteLine("Temperature Reached Threshold. Press Any Key To Continue."); Console.ReadKey(); return(true); } else if ((finch.getLeftLightSensor() + finch.getRightLightSensor()) / 2 >= upperLightThreshold) { for (int i = 0; i < 5; i++) { finch.noteOn(600); finch.wait(50); finch.noteOff(); } Console.WriteLine("Light Reached Threshold. Press Any Key To Continue."); Console.ReadKey(); return(true); } else { return(false); } }
///<summary> ///****************************************************** ///* Talent Show "Mix It Up" ///****************************************************** /// </summary> /// <param name="finchRobot">finch robot object</param> static void DisplayMixingItUp(Finch finchRobot) { Console.CursorVisible = false; DisplayScreenHeader("Mixing It Up"); Console.WriteLine("The Finch robot will now \"mix it up\" for you!"); DisplayContinuePrompt(); finchRobot.setLED(255, 0, 0); finchRobot.noteOn(50); finchRobot.wait(2000); finchRobot.noteOff(); finchRobot.setMotors(255, 255); finchRobot.wait(2000); finchRobot.setMotors(255, 0); finchRobot.wait(2000); finchRobot.setLED(0, 0, 0); finchRobot.setMotors(0, 0); finchRobot.noteOn(100); finchRobot.wait(1000); finchRobot.noteOff(); finchRobot.setLED(0, 255, 0); finchRobot.wait(5000); DisplayMenuPrompt("Talent Show Menu"); }
static void LineSix(Finch finchRobot) { // G finchRobot.noteOn(784); finchRobot.wait(120); finchRobot.noteOff(); finchRobot.wait(50); // F# finchRobot.noteOn(740); finchRobot.wait(120); finchRobot.noteOff(); finchRobot.wait(50); // F finchRobot.noteOn(698); finchRobot.wait(120); finchRobot.noteOff(); finchRobot.wait(50); // D# finchRobot.noteOn(622); finchRobot.wait(120); finchRobot.noteOff(); finchRobot.wait(150); // E finchRobot.noteOn(659); finchRobot.wait(120); finchRobot.noteOff(); finchRobot.wait(150); }
static void DisplayActivateSentryBot(double lowerTempThreshold, int upperLightThreshold, Finch sentryBot) { DisplayHeader("Activate Sentry Bot"); Console.WriteLine(sentryBot.getTemperature()); Console.WriteLine(lowerTempThreshold); do { NominalIndicator(sentryBot); } while (!TemperatureBelowThresholdValue(lowerTempThreshold, sentryBot) && !LightAboveThresholdValue(upperLightThreshold, sentryBot)); if (TemperatureBelowThresholdValue(lowerTempThreshold, sentryBot)) { Console.WriteLine(); Console.WriteLine("The temperature has gone below the threshold value."); sentryBot.noteOn(500); sentryBot.setLED(255, 0, 0); DisplayContinue(); sentryBot.noteOff(); sentryBot.setLED(0, 0, 0); } else if (LightAboveThresholdValue(upperLightThreshold, sentryBot)) { Console.WriteLine(); Console.WriteLine("The light has exceded the threshold value."); sentryBot.noteOn(400); sentryBot.setLED(0, 0, 255); DisplayContinue(); sentryBot.noteOff(); sentryBot.setLED(0, 0, 0); } }
/// <summary> /// ***************************************************************** /// * Talent Show > Mixing It Up * /// ***************************************************************** /// </summary> /// <param name="myFinch">finch robot object</param> static void DisplayMixingItUp(Finch myFinch) { Console.CursorVisible = false; DisplayScreenHeader("Mixing It Up"); Console.WriteLine("\tTHE FINCH ROBOT WILL NOW MIX IT UP ON YA' "); DisplayContinuePrompt(); myFinch.setLED(255, 0, 0); myFinch.noteOn(261); myFinch.wait(1000); myFinch.noteOff(); myFinch.setLED(0, 255, 0); myFinch.setMotors(50, 200); for (int frequency = 0; frequency < 20000; frequency = frequency + 100) { myFinch.noteOn(frequency); myFinch.wait(2); myFinch.noteOff(); } myFinch.wait(3000); myFinch.setMotors(0, 0); myFinch.setMotors(-200, -200); myFinch.wait(1000); myFinch.setMotors(0, 0); myFinch.setLED(0, 0, 0); DisplayMenuPrompt("Talent Show Menu"); }
static void DisplayRedBedroom(Finch finchi) { DisplayHeader("Red Bedroom"); string menuChoice; string messageRedBedroom = ""; Console.WriteLine(); Console.WriteLine(); Console.WriteLine("\t1) Look inside the pillow case."); Console.WriteLine("\t2) Check out the top of the vanity."); Console.WriteLine("\t3) Open the drawers on the nightstand."); Console.WriteLine("\t4) Back"); Console.WriteLine(); Console.Write("Enter Choice"); menuChoice = Console.ReadLine(); switch (menuChoice) { case "1": messageRedBedroom = "Nothing but feathers and dust. You're going to make Finchi sneeze!"; finchi.noteOn(988); finchi.noteOn(587); finchi.noteOff(); break; case "2": messageRedBedroom = "There is a picture of a fancy lady laying there. Finchi wonders if that is who used to own the mansion."; //DisplayFindKey(finchi); break; case "3": messageRedBedroom = "So many socks! But only the left pair..."; break; case "4": DisplaySecondFloor(finchi); break; default: DisplayRedBedroom(finchi); break; } if (messageRedBedroom != "") { Console.Clear(); Console.WriteLine(); Console.WriteLine(messageRedBedroom); DisplayContinuePrompt(); DisplayRedBedroom(finchi); } }
/// <summary> /// ***************************************************************** /// * Talent Show > Light and Sound * /// ***************************************************************** /// </summary> /// <param name="finchRobot">finch robot object</param> static void DisplayLightAndSound(Finch finchRobot) { Console.CursorVisible = false; DisplayScreenHeader("Light and Sound"); Console.WriteLine("\tThe Finch robot will not show off its glowing talent!"); DisplayContinuePrompt(); for (int lightSoundLevel = 0; lightSoundLevel < 210; lightSoundLevel++) { finchRobot.setLED(lightSoundLevel, lightSoundLevel, lightSoundLevel); finchRobot.noteOn(lightSoundLevel * 75); } ColorSelecton: Console.WriteLine("What color would you like to see red , blue or green?"); string userColorResponse = Console.ReadLine(); if (userColorResponse == "red") { finchRobot.setLED(255, 0, 0); } else if (userColorResponse == "green") { finchRobot.setLED(0, 255, 0); } else if (userColorResponse == "blue") { finchRobot.setLED(0, 0, 255); } else { Console.WriteLine("You did not select one of those colors"); goto ColorSelecton; } LowOrHigh: Console.WriteLine("Would you like to hear high or low noise?"); string userNoiseResponse = Console.ReadLine(); if (userNoiseResponse == "high") { finchRobot.noteOn(3000); } else if (userNoiseResponse == "low") { finchRobot.noteOn(500); } else { Console.WriteLine("Please select a low or high frequency"); goto LowOrHigh; } Console.WriteLine("Those are my light and sound talents."); DisplayMenuPrompt("Talent Show Menu"); finchRobot.noteOff(); }
static void ExploreSounds(Finch finchRobot) { finchRobot.noteOn(523); finchRobot.wait(100); finchRobot.noteOn(587); finchRobot.wait(100); finchRobot.noteOn(659); finchRobot.wait(100); finchRobot.noteOn(698); finchRobot.wait(100); finchRobot.noteOn(784); finchRobot.wait(100); finchRobot.noteOn(880); finchRobot.wait(100); finchRobot.noteOn(988); finchRobot.wait(100); finchRobot.noteOn(1047); finchRobot.wait(100); finchRobot.noteOff(); for (int soundValue = 100; soundValue < 15000; soundValue = soundValue + 80) { finchRobot.noteOn(soundValue); finchRobot.wait(1); finchRobot.noteOff(); } }
/// <summary> /// Talent Show /// </summary> /// <param name="finchRobot"></param> static void DisplayTalentShow(Finch finchRobot) { DisplayScreenHeader("Talent Show"); Console.WriteLine("The Finch robot is ready to show you its talent."); DisplayContinuePrompt(); //ENTER MY CODE HERE TO MOVE IT AND STUFF finchRobot.setMotors(75, 75); finchRobot.isObstacleLeftSide(); finchRobot.isObstacleRightSide(); Console.ReadKey(); finchRobot.setMotors(75, 75); finchRobot.isObstacleLeftSide(); finchRobot.isObstacleRightSide(); Console.ReadKey(); finchRobot.setMotors(100, 75); finchRobot.isObstacleLeftSide(); finchRobot.isObstacleRightSide(); Console.ReadKey(); finchRobot.setMotors(100, 75); finchRobot.setLED(255, 0, 0); finchRobot.wait(9000); finchRobot.noteOn(10000); finchRobot.wait(1000); finchRobot.noteOff(); finchRobot.setLED(0, 255, 0); finchRobot.wait(11000); finchRobot.noteOn(7000); finchRobot.wait(1500); finchRobot.setLED(0, 0, 255); finchRobot.wait(12000); finchRobot.noteOn(6500); finchRobot.wait(500); //for (int lightLevel = 0; lightLevel < 255; lightLevel++) //{ // finchRobot.setLED(234, 132, 0); //} DisplayContinuePrompt(); }
// //Robot begins playing a series of notes // private static void RoboticSinging(Finch myFinch) { myFinch.setLED(255, 0, 0); myFinch.noteOn(233); myFinch.wait(2000); myFinch.noteOff(); myFinch.wait(10); myFinch.noteOn(233); myFinch.wait(2000); myFinch.noteOff(); }
/// <summary> /// Talent Show > Light and Sound /// </summary> /// <param name="finchRobot">finch robot object</param> static void DisplayLightAndSound(Finch finchRobot) { Console.CursorVisible = false; DisplayScreenHeader("Light and Sound"); Console.WriteLine("\tThe Finch robot will now show off its glowing talent!"); DisplayContinuePrompt(); for (int soundLevel = 0; soundLevel < 10000; soundLevel = soundLevel + 50) { finchRobot.noteOn(soundLevel); } finchRobot.noteOff(); for (int i = 0; i < 100; i++) { finchRobot.setLED(255, 0, 0); finchRobot.wait(10); finchRobot.setLED(0, 0, 0); finchRobot.wait(10); } for (int soundLevel = 10000; soundLevel > 0; soundLevel = soundLevel - 50) { finchRobot.noteOn(soundLevel); } finchRobot.noteOff(); finchRobot.setMotors(255, -255); finchRobot.wait(1000); finchRobot.setMotors(0, 0); finchRobot.setMotors(-255, 255); finchRobot.wait(1000); finchRobot.setMotors(0, 0); finchRobot.setMotors(255, -255); finchRobot.wait(1000); finchRobot.setMotors(0, 0); finchRobot.setMotors(-255, 255); finchRobot.wait(1000); finchRobot.setMotors(0, 0); finchRobot.setMotors(255, -255); finchRobot.wait(1000); finchRobot.setMotors(0, 0); finchRobot.setMotors(-255, 255); finchRobot.wait(1000); finchRobot.setMotors(0, 0); DisplayMenuPrompt("Talent Show Menu"); }
static void LineThree(Finch finchRobot) { // G finchRobot.noteOn(784); finchRobot.wait(150); finchRobot.noteOff(); finchRobot.wait(50); // E finchRobot.noteOn(659); finchRobot.wait(150); finchRobot.noteOff(); finchRobot.wait(80); // G finchRobot.noteOn(784); finchRobot.wait(150); finchRobot.noteOff(); finchRobot.wait(50); // A finchRobot.noteOn(880); finchRobot.wait(150); finchRobot.noteOff(); finchRobot.wait(80); // F finchRobot.noteOn(698); finchRobot.wait(150); finchRobot.noteOff(); finchRobot.wait(50); // G finchRobot.noteOn(784); finchRobot.wait(150); finchRobot.noteOff(); finchRobot.wait(50); // E finchRobot.noteOn(659); finchRobot.wait(150); finchRobot.noteOff(); finchRobot.wait(200); // C finchRobot.noteOn(523); finchRobot.wait(150); finchRobot.noteOff(); finchRobot.wait(30); // B finchRobot.noteOn(988); finchRobot.wait(150); finchRobot.noteOff(); finchRobot.wait(30); // D finchRobot.noteOn(587); finchRobot.wait(150); finchRobot.noteOff(); finchRobot.wait(250); }
/// <summary> /// ***************************************************************** /// * Talent Show > Light and Sound * /// ***************************************************************** /// </summary> /// <param name="finchRobot">finch robot object</param> static void DisplayLightAndSound(Finch finchRobot) { Console.CursorVisible = true; DisplayScreenHeader("Light and Sound (modified)"); Console.WriteLine("\tThe Finch robot will show off its glowing talent!"); bool validResponse; int red; int green; int blue; do { validResponse = true; Console.Write(" Enter a starting color (red, green, or blue:"); string userResponse = Console.ReadLine(); if (userResponse == "red") { validResponse = true; for (int lightSoundLevel = 0; lightSoundLevel < 255; lightSoundLevel++) { finchRobot.setLED(lightSoundLevel, 0, 0); finchRobot.noteOn(lightSoundLevel * 99); } } else if (userResponse == "green") { validResponse = true; for (int lightSoundLevel = 0; lightSoundLevel < 255; lightSoundLevel++) { finchRobot.setLED(0, lightSoundLevel, 0); finchRobot.noteOn(lightSoundLevel * 99); } } else if (userResponse == "blue") { validResponse = true; for (int lightSoundLevel = 0; lightSoundLevel < 255; lightSoundLevel++) { finchRobot.setLED(0, 0, lightSoundLevel); finchRobot.noteOn(lightSoundLevel * 99); } } } while (validResponse != true); DisplayContinuePrompt(); DisplayMenuPrompt("Talent Show Menu"); }
// // Talent Show > Mixing it up // static void TalentShowDisplayMixingItUp(Finch finchRobot) { Console.CursorVisible = false; DisplayScreenHeader("Mixing it up"); Console.WriteLine("\tThe Finch robot will now do all of the cool things I know how to tell it to do!"); DisplayContinuePrompt(); finchRobot.setLED(255, 0, 0); finchRobot.setMotors(200, 100); finchRobot.wait(1000); finchRobot.setLED(0, 255, 0); finchRobot.setMotors(0, 0); finchRobot.setMotors(-200, -100); finchRobot.wait(1000); finchRobot.setMotors(0, 0); for (int lightSoundLevel = 0; lightSoundLevel < 255; lightSoundLevel++) { finchRobot.setLED(lightSoundLevel, lightSoundLevel, lightSoundLevel); finchRobot.noteOn(lightSoundLevel * 100); } finchRobot.setMotors(100, 200); finchRobot.wait(1000); finchRobot.setMotors(0, 0); finchRobot.setMotors(-100, -200); finchRobot.wait(1000); finchRobot.setMotors(0, 0); finchRobot.setMotors(200, 100); finchRobot.wait(1000); finchRobot.setMotors(0, 0); finchRobot.setMotors(-200, -100); finchRobot.wait(1000); finchRobot.setMotors(0, 0); for (int lightSoundLevel = 255; lightSoundLevel > 0; lightSoundLevel--) { finchRobot.setLED(lightSoundLevel, lightSoundLevel, lightSoundLevel); finchRobot.noteOn(lightSoundLevel * 100); finchRobot.noteOff(); } finchRobot.setLED(0, 0, 255); finchRobot.setMotors(100, 200); finchRobot.wait(1000); finchRobot.setMotors(0, 0); finchRobot.setMotors(-100, -200); finchRobot.wait(1000); finchRobot.setMotors(0, 0); DisplayMenuPrompt("Talent Show Menu"); }
/// <summary> /// Moving and lights! /// </summary> /// <param name="Reznor"></param> static void MixItUpMenu(Finch Reznor) { Console.CursorVisible = false; DisplayHeader("Lets get silly up in here! Dancing! Light show! Music!\n"); DisplayContinuePromt(); Reznor.setLED(50, 100, 200); Reznor.noteOn(263); Reznor.setMotors(-100, 100); Reznor.wait(2000); Reznor.setMotors(0, 0); Reznor.setLED(100, 200, 0); Reznor.noteOn(138); Reznor.setMotors(100, -100); Reznor.wait(2000); Reznor.setLED(0, 50, 255); Reznor.noteOn(800); Reznor.setMotors(100, 100); Reznor.wait(2000); Reznor.setMotors(0, 0); Reznor.setLED(10, 20, 50); Reznor.noteOn(138); Reznor.setMotors(30, -30); Reznor.wait(2000); Reznor.setLED(50, 100, 200); Reznor.noteOn(263); Reznor.setMotors(-100, 100); Reznor.wait(2000); Reznor.setMotors(0, 0); Reznor.setLED(100, 200, 0); Reznor.noteOn(138); Reznor.setMotors(100, -100); Reznor.wait(2000); Reznor.setLED(0, 50, 255); Reznor.noteOn(800); Reznor.setMotors(100, 100); Reznor.wait(2000); Reznor.setMotors(0, 0); Reznor.setLED(10, 20, 50); Reznor.noteOn(138); Reznor.setMotors(30, -30); Reznor.wait(2000); Reznor.noteOff(); Reznor.setLED(0, 0, 0); Console.WriteLine("Wow, wasn't that something!"); DisplayMenuPrompt("Talent Show"); //for (int allTheThings = 0; allTheThings < 1000 ; allTheThings ++) //{ // Reznor.setLED(30, 74, 100); // Reznor.noteOn(allTheThings * 20); // Reznor.setMotors(allTheThings, allTheThings); // Reznor.setLED(100, 50, 60); //} }
static void DisplayMixing(Finch myFinch) { // // Display of Finch's functions in mixing // Console.CursorVisible = false; DisplayScreenHeader("Mixing It Up"); Console.WriteLine("\tThe Finch robot will show off it's moves!"); DisplayContinuePrompt(); for (int looptwo = 0; looptwo < 8; looptwo++) { myFinch.setMotors(150, 150); // move myFinch.wait(200); myFinch.setMotors(0, 0); // stop myFinch.setLED(100, 100, 100); // turn on LEDs myFinch.noteOn(450); // turn on note myFinch.wait(200); myFinch.noteOff(); // turn off note myFinch.setLED(0, 0, 0); // turn off LEDs } DisplayMenuPrompt("Talent Show!"); }
static void DisplayMixingItUp(Finch myFinch) { Console.CursorVisible = false; DisplayScreenHeader("Mixing It Up"); Console.WriteLine("\tThe Finch robot will now go crazy!"); DisplayContinuePrompt(); myFinch.setMotors(150, 150); myFinch.wait(500); myFinch.setMotors(-35, 35); myFinch.wait(500); myFinch.setMotors(150, 150); myFinch.wait(500); myFinch.setMotors(-35, 35); for (int lightSoundLevel = 25; lightSoundLevel < 255; lightSoundLevel++) { myFinch.setLED(lightSoundLevel, lightSoundLevel, lightSoundLevel); myFinch.noteOn(lightSoundLevel * 100); } DisplayMenuPrompt("Talent Show Menu"); }
static void DisplayMixingItUp(Finch finchRobot) { DisplayScreenHeader("Mixing It Up"); for (int lightSoundLevel = 0; lightSoundLevel < 255; lightSoundLevel++) { finchRobot.setLED(255, 0, 0); finchRobot.wait(500); finchRobot.setLED(0, 0, 0); finchRobot.setLED(255, 0, 255); finchRobot.wait(500); finchRobot.setLED(255, 0, 255); finchRobot.wait(500); finchRobot.setLED(0, 255, 255); finchRobot.wait(500); finchRobot.setLED(0, 255, 0); finchRobot.wait(500); finchRobot.setLED(0, 0, 255); finchRobot.noteOn(lightSoundLevel * 100); finchRobot.wait(500); finchRobot.setMotors(255, 255); finchRobot.wait(500); finchRobot.setMotors(0, 0); finchRobot.setMotors(-255, 255); finchRobot.wait(1000); finchRobot.setMotors(0, 0); } DisplayContinuePrompt(); }
// // display connect finch robot // static bool DisplayConnectFinchRobot(Finch finchRobot) { bool finchRobotConnected = false; DisplayScreenHeader("Connect Finch Robot"); Console.WriteLine("Ready to connect to the Finch Robot. Please be sure to connect the USB cable to the robot and the computer."); DisplayContinuePrompt(); Console.Clear(); Console.WriteLine(); finchRobotConnected = finchRobot.connect(); if (finchRobotConnected) { finchRobot.setLED(0, 255, 0); finchRobot.noteOn(15000); finchRobot.wait(250); finchRobot.noteOff(); finchRobot.setLED(0, 0, 0); Console.WriteLine(); Console.WriteLine("Finch robot is now connected."); } else { Console.WriteLine(); Console.WriteLine("Unable to connect to the Finch robot."); } DisplayContinuePrompt(); return(finchRobotConnected); }
/// <summary> /// Shut down the Finch robot /// </summary> /// <param name="myFinch"></param> private static void TerminateFinch(Finch myFinch) { Console.Clear(); Console.WriteLine(); Console.WriteLine("Attempting to disconnect from the Finch robot."); Console.WriteLine(); // // Audio/visual feedback to user // for (int increment = 255; increment > 0; increment -= 10) { myFinch.setLED(0, increment, 0); myFinch.noteOn(increment * 100); myFinch.wait(200); } myFinch.setLED(0, 0, 0); myFinch.noteOff(); myFinch.disConnect(); Console.Clear(); Console.WriteLine(); Console.WriteLine("The Finch robot is now disconnected."); Console.WriteLine(); DisplayContinuePrompt(); }
static void DisplayActivateSentrybot(double lowerTempThresholdValue, Finch myfinch, double lowerLightThreshold) { double ambientTemp; double ambientLight; ambientTemp = myfinch.getTemperature(); //ambientLight = myfinch.getRightLightSensor() + myfinch.getLeftLightSensor(); ambientLight = myfinch.getLightSensors().Average(); DisplayHeader("Activate Sentry Bot"); Console.WriteLine($"The ambient temperature is {ambientTemp}"); Console.WriteLine($"The lower Temperature Threshold is {lowerTempThresholdValue}"); while (!TemperatureBelowThresholdValue(lowerTempThresholdValue, myfinch) && !LightAboveThresholdValue(lowerLightThreshold, myfinch)) { Console.WriteLine($"light threshold{lowerLightThreshold}, light {ambientLight}, temp threshold {lowerTempThresholdValue}, temp {ambientTemp}"); TemperatureNominalIndicator(myfinch); } //if (TemperatureBelowThresholdValue(lowerTempThresholdValue, myfinch) && LightAboveThresholdValue(lowerLightThreshold, myfinch)) //{ myfinch.noteOn(250); myfinch.setLED(255, 0, 0); myfinch.wait(3000); myfinch.noteOff(); myfinch.setLED(0, 0, 0); //} DisplayContinuePrompt(); }
static bool DisplayConnectFinchRobot(Finch finchRobot) { bool robotConnected; DisplayScreenHeader("Connect Finch Robot"); Console.WriteLine("About to connect to Finch robot. Please be sure the USB cable is connected to the robot and computer now."); DisplayContinuePrompt(); robotConnected = finchRobot.connect(); if (robotConnected) { finchRobot.setLED(0, 255, 0); finchRobot.noteOn(15000); finchRobot.wait(1000); finchRobot.noteOff(); Console.WriteLine("The Finch robot is now connected."); } else { Console.WriteLine("Unable to connect to the Finch robot."); } DisplayContinuePrompt(); return(robotConnected); }
/// <summary> /// ***************************************************************** /// * Connect the Finch Robot * /// ***************************************************************** /// </summary> /// <param name="finchRobot">finch robot object</param> /// <returns>notify if the robot is connected</returns> static bool DisplayConnectFinchRobot(Finch finchRobot) { Console.CursorVisible = false; bool robotConnected; DisplayScreenHeader("Connect Finch Robot"); Console.WriteLine("\tAbout to connect to Finch robot. Please be sure the USB cable is connected to the robot and computer now."); DisplayContinuePrompt(); robotConnected = finchRobot.connect(); if (robotConnected) { Console.WriteLine("Connect Finch Robot"); finchRobot.setLED(0, 255, 0); finchRobot.noteOn(261); finchRobot.wait(1000); finchRobot.setLED(0, 0, 0); finchRobot.setLED(0, 0, 0); } // TODO test connection and provide user feedback - text, lights, sounds DisplayMenuPrompt("Main Menu"); // // reset finch robot // finchRobot.setLED(0, 0, 0); finchRobot.noteOff(); return(robotConnected); }
/// <summary> /// ***************************************************************** /// * Talent Show > Light and Sound * /// ***************************************************************** /// </summary> /// <param name="finchRobot">finch robot object</param> static void DisplayLightAndSound(Finch finchRobot) { Console.CursorVisible = false; DisplayScreenHeader("Light and Sound"); Console.WriteLine("\tThe Finch robot will now show off its glowing talent!"); DisplayContinuePrompt(); for (int lightSoundLevel = 0; lightSoundLevel < 255; lightSoundLevel++) { finchRobot.setLED(255, 0, 0); finchRobot.wait(500); finchRobot.setLED(0, 0, 0); finchRobot.setLED(255, 0, 255); finchRobot.wait(500); finchRobot.setLED(255, 0, 255); finchRobot.wait(500); finchRobot.setLED(0, 255, 255); finchRobot.wait(500); finchRobot.setLED(0, 255, 0); finchRobot.wait(500); finchRobot.setLED(0, 0, 255); finchRobot.noteOn(lightSoundLevel * 100); finchRobot.wait(500); } DisplayMenuPrompt("Talent Show Menu"); }
/// <summary> /// ***************************************************************** /// * Talent Show > Light and Sound * /// ***************************************************************** /// </summary> /// <param name="finchRobot">finch robot object</param> static void DisplayLightAndSound(Finch finchRobot) { string lightSound1; string lightSound2; string lightSoundLED; Console.CursorVisible = false; DisplayScreenHeader("Light and Sound"); Console.Write("Please enter frequency of sound:"); lightSound1 = Console.ReadLine(); Console.Write("Please enter length of sound:"); lightSound2 = Console.ReadLine(); Console.Write("Please enter number for color of LED:"); lightSoundLED = Console.ReadLine(); Console.WriteLine("\tThe Finch robot will now show off its glowing talent!"); DisplayContinuePrompt(); for (int lightSoundLevel = Convert.ToInt32(lightSound1); lightSoundLevel < Convert.ToInt32(lightSound2); lightSoundLevel++) { finchRobot.setLED(lightSoundLevel, lightSoundLevel, lightSoundLevel); finchRobot.noteOn(lightSoundLevel * Convert.ToInt32(lightSoundLED)); } DisplayMenuPrompt("Talent Show Menu"); }
/// <summary> /// display initialize screen /// </summary> static void DisplayInitializeFinch() { DisplayScreen("Initialize Finch"); finchActive = tim.connect(); Console.WriteLine($"Finch connected: {finchActive}"); if (finchActive) { tim.noteOn(500); tim.setLED(255, 255, 255); tim.wait(500); tim.setLED(0, 0, 0); tim.noteOff(); } DisplayAnyKey(); }
// //Finch is angry // private static void AngryFinch(Finch myFinch) { myFinch.setLED(255, 0, 0); myFinch.noteOn(500); myFinch.wait(1000); myFinch.noteOff(); myFinch.setLED(0, 0, 255); }
static void LineEleven(Finch finchRobot) { // D# finchRobot.noteOn(622); finchRobot.wait(200); finchRobot.noteOff(); finchRobot.wait(200); // D finchRobot.noteOn(587); finchRobot.wait(200); finchRobot.noteOff(); finchRobot.wait(200); // C finchRobot.noteOn(523); finchRobot.wait(200); finchRobot.noteOff(); }