/// <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> /// ***************************************************************** /// * 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"); }
/// <summary> /// ***************************************************************** /// * Talent Show > Light, Sound, And Move * /// ***************************************************************** /// </summary> /// <param name="finchRobot">finch robot object</param> private static void DisplayLightSoundAndMove(Finch finchRobot) { Console.CursorVisible = false; DisplayScreenHeader("DisplayLightSoundAndMove"); Console.WriteLine("\tThe Finch robot will now show off it's lights while doing a song and dance."); DisplayContinuePrompt(); for (int i = 0; i < 1; i++) { DisplayMusic(finchRobot); finchRobot.setLED(i, 255, i); finchRobot.setMotors(255, 255); finchRobot.wait(2000); finchRobot.setMotors(-255, -255); finchRobot.wait(200); finchRobot.setMotors(255, 128); finchRobot.wait(200); finchRobot.setMotors(128, 255); finchRobot.wait(200); } finchRobot.setMotors(0, 0); DisplayMenuPrompt("Talent Show Menu"); }
/// ***************************************************************** /// * Talent Show > Dance * /// ***************************************************************** /// /// <param name="myFinch"></param> static void DisplayDance(Finch myFinch) { string shape; Console.CursorVisible = false; DisplayScreenHeader("Dance"); Console.WriteLine("\tWhich shape would you like the finch to go in?"); Console.WriteLine("a) Circle"); Console.WriteLine("b) Square"); shape = Console.ReadLine(); switch (shape) { case "a": Console.WriteLine("The finch will now move in a circle"); DisplayContinuePrompt(); for (int Pattern = 0; Pattern < 4; Pattern++) { //myFinch.setMotors(100, 100); //myFinch.wait(200); //myFinch.setMotors(-100, -100); //myFinch.wait(200); myFinch.setMotors(255, 50); myFinch.wait(1000); } break; case "b": Console.WriteLine("The finch will now move in a square"); DisplayContinuePrompt(); for (int pattern = 0; pattern < 1; pattern++) { myFinch.setMotors(255, 255); myFinch.wait(500); myFinch.setMotors(255, 50); myFinch.wait(550); myFinch.setMotors(255, 255); myFinch.wait(500); myFinch.setMotors(255, 50); myFinch.wait(550); myFinch.setMotors(255, 255); myFinch.wait(500); myFinch.setMotors(255, 50); myFinch.wait(550); myFinch.setMotors(255, 255); myFinch.wait(500); myFinch.setMotors(255, 50); myFinch.wait(550); } break; default: Console.WriteLine("Please enter (a) or (b)"); break; } myFinch.setMotors(0, 0); DisplayMenuPrompt("Talent Show Menu"); }
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"); }
private void btn_Forward_Click_1(object sender, EventArgs e) { // //Move the Finch forward // Ayew.setMotors(255, 255); }
/// <summary> /// third choice /// </summary> /// <param name="secondsOfCrawl"></param> /// <param name="SneakyFinch"></param> static void StairWell(int secondsOfCrawl, Finch SneakyFinch) { bool hit; for (int seconds = 0; seconds < secondsOfCrawl * 10; seconds++) { SneakyFinch.setMotors(255, 255); Console.Clear(); Console.WriteLine(SneakyFinch.getRightLightSensor()); if (SneakyFinch.getLeftLightSensor() > 150) { hit = true; SneakyFinch.setMotors(-100, -25); SneakyFinch.setLED(255, 0, 0); SneakyFinch.wait(3000); SneakyFinch.setMotors(100, 25); SneakyFinch.wait(3000); } else { hit = false; SneakyFinch.setMotors(100, 25); SneakyFinch.setMotors(100, 100); } } }
/// ***************************************************************** /// * Talent Show > Mixing It Up * /// ***************************************************************** /// /// <param name="myFinch"></param> static void DisplayMixingItUp(Finch myFinch) { Console.CursorVisible = false; DisplayScreenHeader("Mix It Up"); Console.WriteLine("\tThe Finch robot will now do a little bit of everything!"); DisplayContinuePrompt(); for (int Mix = 0; Mix < 1; Mix++) { DisplayMusic(myFinch); myFinch.setLED(Mix, 255, Mix); myFinch.setMotors(255, 0); myFinch.wait(200); myFinch.setMotors(0, 255); myFinch.wait(200); myFinch.setMotors(-255, 0); myFinch.wait(200); myFinch.setMotors(0, -255); myFinch.wait(200); } myFinch.setMotors(0, 0); DisplayMenuPrompt("Talent Show Menu"); }
///<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 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(); }
static void ExecuteCommands() { Console.Clear(); Console.WriteLine(); Console.WriteLine(); Console.WriteLine("Execute Commands"); Console.WriteLine(); Console.WriteLine(); DisplayContinuePrompt(); foreach (FinchCommand command in commands) { switch (command) { case FinchCommand.DONE: break; case FinchCommand.MOVEFORWARD: Console.WriteLine("Now moving forward."); myFinch.setMotors(motorSpeed, motorSpeed); break; case FinchCommand.MOVEBACKWARD: Console.WriteLine("Now moving backward."); myFinch.setMotors(-motorSpeed, -motorSpeed); break; case FinchCommand.STOPMOTORS: myFinch.setMotors(0, 0); break; case FinchCommand.DELAY: myFinch.wait(delayDuration); break; case FinchCommand.TURNRIGHT: myFinch.setMotors(motorSpeed, -motorSpeed); break; case FinchCommand.TURNLEFT: myFinch.setMotors(-motorSpeed, motorSpeed); break; case FinchCommand.LEDON: myFinch.setLED(LEDBrightness, LEDBrightness, LEDBrightness); break; case FinchCommand.LEDOFF: myFinch.setLED(0, 0, 0); break; default: break; } } DisplayContinuePrompt(); }
static void Main(string[] args) { Sam.connect(); DisplayWelcomeScreen(); FinchShields shieldLevel = GetUserShieldLevel(); int speed = 0; ambientTemperature = GetTempature(); switch (shieldLevel) { case FinchShields.HIGH: speed = 100; break; case FinchShields.MEDIUM: speed = 75; break; case FinchShields.LOW: speed = 50; break; default: break; } DisplayContinuePrompt(); Console.Clear(); MoveSamForward(speed); Console.WriteLine("Super Finch is marching forward into battle!"); do { switch (shieldLevel) { case FinchShields.HIGH: Sam.setLED(0, 255, 0); break; case FinchShields.MEDIUM: Sam.setLED(0, 0, 255); break; case FinchShields.LOW: Sam.setLED(255, 0, 0); break; default: break; } shieldLevel = HitDetection(shieldLevel); } while (shieldLevel != FinchShields.FAILED); Sam.setMotors(0, 0); Console.WriteLine("Game Over!"); DisplayContinuePrompt(); }
static void DisplayDance(Finch finchRobot) { for (int times = 0; times < 4; times++) { finchRobot.setMotors(255, 255); finchRobot.setMotors(255, 0); } }
static void DisplayKitchen(Finch finchi) { DisplayHeader("Kitchen"); string menuChoice; string messageKitchen = ""; Console.WriteLine(); Console.WriteLine(); Console.WriteLine("\t1) Check inside the icebox."); Console.WriteLine("\t2) Look in the cupboards."); Console.WriteLine("\t3) Eat the fruit on the table."); Console.WriteLine("\t4) Back"); Console.WriteLine(); Console.Write("Enter Choice"); menuChoice = Console.ReadLine(); switch (menuChoice) { case "1": messageKitchen = "Doesn't look like there has been any ice in here in a long time..."; break; case "2": messageKitchen = "Just a bunch of broken plates and cups."; break; case "3": messageKitchen = "It's not real! Its plastic apples. Ew!"; finchi.setMotors(-200, -200); finchi.setLED(255, 0, 0); finchi.wait(500); finchi.setMotors(0, 0); finchi.setLED(0, 0, 0); break; case "4": DisplayFirstFloor(finchi); break; default: DisplayKitchen(finchi); break; } if (messageKitchen != "") { Console.Clear(); Console.WriteLine(); Console.WriteLine(messageKitchen); DisplayContinuePrompt(); DisplayKitchen(finchi); } }
static void DisplayExecuteFinchCommands(FinchCommand[] commands, Finch finch, int motorSpeed, int LEDBrightness, int delayDuration) { DisplayHeader("Execute Finch Commands"); Console.WriteLine("Press any key to execute commands..."); Console.ReadKey(); for (int i = 0; i < commands.Length; i++) { Console.WriteLine($"Command {i+1}/{commands.Length}: {commands[i]}"); switch (commands[i]) { case FinchCommand.DONE: finch.disConnect(); break; case FinchCommand.MOVEFORWARD: finch.setMotors(motorSpeed, motorSpeed); break; case FinchCommand.MOVEBACKWARD: finch.setMotors(-motorSpeed, -motorSpeed); break; case FinchCommand.STOPMOTORS: finch.setMotors(0, 0); break; case FinchCommand.DELAY: finch.wait(delayDuration); break; case FinchCommand.TURNRIGHT: finch.setMotors(motorSpeed, motorSpeed / 2); break; case FinchCommand.TURNLEFT: finch.setMotors(motorSpeed, motorSpeed / 2); break; case FinchCommand.LEDON: finch.setLED(LEDBrightness, LEDBrightness, LEDBrightness); break; case FinchCommand.LEDOFF: finch.setLED(0, 0, 0); break; default: Console.WriteLine("Function non-existent"); break; } } DisplayContinuePrompt(); }
static void DisplayExecuteFinchCommands(Finch myFinch, FinchCommand[] commands, int motorSpeed, int lEDBrightness, int delayDuration) { DisplayHeader("Execute Finch Commands"); Console.WriteLine("Press any key when ready to execute commands."); DisplayContinuePrompt(); for (int index = 0; index < commands.Length; index++) { Console.WriteLine($"Command: {commands[index]}"); switch (commands[index]) { case FinchCommand.DONE: break; case FinchCommand.MOVEFORWARD: myFinch.setMotors(motorSpeed, motorSpeed); break; case FinchCommand.MOVEBACKWARD: myFinch.setMotors(-motorSpeed, -motorSpeed); break; case FinchCommand.STOPMOTORS: myFinch.setMotors(0, 0); break; case FinchCommand.DELAY: myFinch.wait(delayDuration); break; case FinchCommand.TURNRIGHT: myFinch.setMotors(motorSpeed, -motorSpeed); break; case FinchCommand.TURNLEFT: myFinch.setMotors(-motorSpeed, motorSpeed); break; case FinchCommand.LEDON: myFinch.setLED(lEDBrightness, lEDBrightness, lEDBrightness); break; case FinchCommand.LEDOFF: myFinch.setLED(0, 0, 0); break; default: break; } } DisplayContinuePrompt(); }
private static void DisplayExicuteFinchCommands(Finch myFinch, List <FinchCommand> commands, int delayDuration, int motorSpeed, int lEDBrightness) { DisplayHeader("Execute Finch Commands"); Console.WriteLine("Press any key to execute commands"); Console.ReadKey(); for (int i = 0; i < commands.Count; i++) { Console.WriteLine("Command : " + commands[i]); switch (commands[i]) { case FinchCommand.DONE: break; case FinchCommand.MOVEFORWARD: myFinch.setMotors(motorSpeed, motorSpeed); break; case FinchCommand.MOVEBACKWARD: myFinch.setMotors(-motorSpeed, -motorSpeed); break; case FinchCommand.STOPMOTORS: myFinch.setMotors(0, 0); break; case FinchCommand.DELAY: myFinch.wait(delayDuration); break; case FinchCommand.TURNRIGHT: myFinch.setMotors(motorSpeed, (motorSpeed / 2)); break; case FinchCommand.TURNLEFT: myFinch.setMotors((motorSpeed / 2), motorSpeed); break; case FinchCommand.LEDON: myFinch.setLED(lEDBrightness, lEDBrightness, lEDBrightness); break; case FinchCommand.LEDOFF: myFinch.setLED(0, 0, 0); break; default: break; } } DisplayContinuePrompt(); }
//movement option static void DisplayMovement(Finch myFinch) { DisplayScreenHeader("Finch Movement"); myFinch.setMotors(200, 200); myFinch.wait(500); myFinch.setMotors(0, 0); DisplayMenuPrompt("Talent Show"); }
static void DisplayMovement(Finch finchRobot) { DisplayScreenHeader("Movement"); finchRobot.setMotors(255, 255); finchRobot.wait(1000); finchRobot.setMotors(0, 0); DisplayMenuPrompt("Talent Show"); }
/// <summary> /// ***************************************************************** /// * Talent Show Dance * /// ***************************************************************** /// </summary> /// <param name="finchRobot">finch robot object</param> static void DisplayDance(Finch finchRobot) { Console.CursorVisible = false; DisplayScreenHeader("Dance"); Console.WriteLine("\t The Finch robot will now show off its moves!"); DisplayContinuePrompt(); finchRobot.setMotors(255, 255); finchRobot.wait(1000); finchRobot.setMotors(0, 255); finchRobot.wait(1000); finchRobot.setMotors(255, 255); finchRobot.wait(1000); finchRobot.setMotors(0, 255); finchRobot.wait(1000); finchRobot.setMotors(255, 255); finchRobot.wait(1000); finchRobot.setMotors(0, 255); finchRobot.wait(1000); finchRobot.setMotors(255, 255); finchRobot.wait(1000); finchRobot.setMotors(0, 255); finchRobot.setMotors(0, 0); DisplayMenuPrompt("Talent Show Menu"); }
/// <summary> /// Finch will try to get out of a room /// </summary> static void Maze() { DisplayHeader("Running"); myFinch.wait(1000); Console.WriteLine("Trying to get out of the room..."); int speed = 100; int waitTime = 1000; bool running = true; while (running) { myFinch.setLED(255, 255, 255); myFinch.setMotors(speed, speed); if (myFinch.isObstacleLeftSide()) { myFinch.setLED(0, 0, 255); myFinch.setMotors(-speed, -speed); myFinch.wait(waitTime); myFinch.setMotors(speed, 0); myFinch.wait(waitTime); myFinch.setLED(255, 255, 255); } if (myFinch.isObstacleRightSide()) { myFinch.setLED(255, 0, 0); myFinch.setMotors(-speed, -speed); myFinch.wait(waitTime); myFinch.setMotors(0, speed); myFinch.wait(waitTime); myFinch.setLED(255, 255, 255); } } }
static void DisplayExecuteFinchCommands(Finch finchRobot, List <String> commands, int motorSpeed, int ledBrightness, double waitSeconds) { DisplayScreenHeader("Execute Commands"); Console.WriteLine("Will execute all specified commands"); foreach (var userCommand in commands) { if (userCommand == "MOVEFORWARD") { Console.WriteLine("Moving forwards\n"); finchRobot.setMotors(motorSpeed, motorSpeed); } else if (userCommand == "MOVEBACKWARD") { Console.WriteLine("Moving backwards\n"); finchRobot.setMotors(motorSpeed - (motorSpeed * 2), motorSpeed - (motorSpeed * 2)); } else if (userCommand == "STOPMOTORS") { Console.WriteLine("Stopping\n"); finchRobot.setMotors(0, 0); } else if (userCommand == "WAIT") { Console.WriteLine("Waiting\n"); finchRobot.wait(Convert.ToInt32(waitSeconds)); } else if (userCommand == "TURNRIGHT") { Console.WriteLine("Turning right\n"); finchRobot.setMotors(motorSpeed, 0); } else if (userCommand == "TURNLEFT") { Console.WriteLine("Turning left\n"); finchRobot.setMotors(0, motorSpeed); } else if (userCommand == "LEDON") { Console.WriteLine("Turning LED on\n"); finchRobot.setLED(ledBrightness, ledBrightness, ledBrightness); } else if (userCommand == "LEDOFF") { Console.WriteLine("Turning LED off\n"); finchRobot.setLED(0, 0, 0); } else if (userCommand == "GETTEMPERATURE") { Console.WriteLine("Getting temperature\n"); Console.WriteLine($"Temperature (C): {0}\n", finchRobot.getTemperature()); } } DisplayContinuePrompt(); }
/// <summary> /// ***************************************************************** /// * Talent Show > Dance * /// ***************************************************************** /// </summary> /// <param name="finchRobot">finch robot object</param> static void Dance(Finch finchRobot, int danceType, int danceArea, int danceTime) { Console.CursorVisible = false; Console.WriteLine("Still in development"); finchRobot.setMotors(-255, 255); Thread.Sleep(2); finchRobot.setMotors(255, -255); Thread.Sleep(2); finchRobot.setMotors(0, 0); }
/// <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(); }
static void DisplayMixing(Finch myFinch) { myFinch.setLED(200, 0, 0); myFinch.setMotors(200, 200); myFinch.wait(1000); myFinch.setMotors(0, 0); myFinch.noteOn(500); myFinch.wait(200); myFinch.noteOff(); myFinch.setLED(0, 0, 0); }
/// <summary> /// ***************************************************************** /// * Talent Show > Bust a Move * /// ***************************************************************** /// </summary> /// <param name="finchRobot">finch robot object</param> static void TalentShowBustAMove(Finch finchRobot) { Console.CursorVisible = false; DisplayScreenHeader("Bust A move"); Console.WriteLine("\tThe Finch robot will now show off its cool moves!"); finchRobot.setMotors(-255, 69); finchRobot.setMotors(100, -100); finchRobot.setMotors(255, -255); DisplayContinuePrompt(); }
// // TODO - 3) Change the type in the parameter list to a list of FinchCommand // /// <summary> /// Process each command /// </summary> /// <param name="myFinch">Finch robot object</param> /// <param name="commands">FinchCommand</param> private static void ProcessFinchCommands(Finch myFinch, FinchCommand[] commands, int motorSpeed, int ledBrightness, int delayDuration) { Console.Clear(); Console.WriteLine(); Console.WriteLine("The application will now process your command sequence."); Console.WriteLine(); foreach (FinchCommand command in commands) { Console.WriteLine("Command Currently Executing: " + command.ToString()); switch (command) { case FinchCommand.DONE: break; case FinchCommand.MOVEFORWARD: myFinch.setMotors(motorSpeed, motorSpeed); break; case FinchCommand.MOVEBACKWARD: myFinch.setMotors(-motorSpeed, -motorSpeed); break; case FinchCommand.STOPMOTORS: myFinch.setMotors(0, 0); break; case FinchCommand.DELAY: myFinch.wait(delayDuration); break; case FinchCommand.TURNRIGHT: myFinch.setMotors(motorSpeed, -motorSpeed); break; case FinchCommand.TURNLEFT: myFinch.setMotors(-motorSpeed, motorSpeed); break; case FinchCommand.LEDON: myFinch.setLED(ledBrightness, ledBrightness, ledBrightness); break; case FinchCommand.LEDOFF: myFinch.setLED(0, 0, 0); break; default: break; } } }
//--------// //Movement// //--------// static void DisplayMoves(Finch myFinch) { DisplayHeader("Moves"); myFinch.setMotors(255, 255); myFinch.wait(1000); myFinch.setMotors(-255, -255); myFinch.wait(1000); myFinch.setMotors(0, 0); DisplayContinuePrompt(); DisplayTalentShow(myFinch); }
static void DisplayDance(Finch myFinch) { DisplayScreenHeader("Finchy Moves"); myFinch.setMotors(255, 255); myFinch.wait(500); myFinch.setMotors(0, 0); myFinch.setMotors(-255, 255); myFinch.wait(1000); myFinch.setMotors(0, 0); DisplayContinuePrompt(); }