mbed報告
阿新 • • 發佈:2018-12-13
while(1) { Reset the central motors. while(1) { Read the distance from the player to the machine. if(the distance meets the requirements) break; else { Output commands to ask the player to approach or stay away; continue; } } while(1) { Read ID nunber from a card. if(the card is from a normal player) { Use the color sensor the determine the difficulty of the game. Game starts. Popped the ball through the motor and electromagnet. Auxiliary motor cycle rotation to increase game fun. if(succeed in 30 seconds) { Faster flashing of prompt lamp } else { Slow flashing of the prompt lamp. Rotate the auxiliary motors to reset the ball. } } else if(the card is from a administrator) { No ball popping out. It is able to rotate rotate each motor, read data from color sensors, distance sensors separately. } } }