513
edits
Line 60: | Line 60: | ||
The robot stands still and waits for further instructions. | The robot stands still and waits for further instructions. | ||
It is now in standby mode. | It is now in standby mode. | ||
[[File:diagramStateMachine1.jpg]] | |||
Line 67: | Line 68: | ||
The robot starts to clean the room. | The robot starts to clean the room. | ||
It moves forward and activates the air pump. | It moves forward and activates the air pump. | ||
[[File:diagramStateMachine2.jpg]] | |||
Line 74: | Line 76: | ||
The robot would bump into the next wall if it would only be able to move forward. | The robot would bump into the next wall if it would only be able to move forward. | ||
It therefore needs a function that recognizes walls and makes the robot turn around. | It therefore needs a function that recognizes walls and makes the robot turn around. | ||
[[File:diagramStateMachine3.jpg]] | |||
Line 82: | Line 85: | ||
We have to define a parameter that tells the robot if it turned enough in order to continue cleaning. | We have to define a parameter that tells the robot if it turned enough in order to continue cleaning. | ||
This parameter can be a time delay, a certain amount of wheel revolutions or the value of a (distance, ..) sensor. | This parameter can be a time delay, a certain amount of wheel revolutions or the value of a (distance, ..) sensor. | ||
[[File:diagramStateMachine4.jpg]] | |||
Line 88: | Line 92: | ||
The final missing part is the off-button. | The final missing part is the off-button. | ||
[[File:diagramStateMachine5.jpg]] | |||
==Writing the Program== | ==Writing the Program== |
edits