Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
mindstorms:plnxt:first_steps [2009/02/21 19:41] holownia |
mindstorms:plnxt:first_steps [2019/06/27 15:50] (current) |
go_on_buddy :- | go_on_buddy :- |
nxt_go(200), | nxt_go(200), |
sleep(1), % Chwila przerwy, żeby jedno klaśnięcie nie zostało rozpoznane jako dwa. | sleep(1), % Short break, so one clap would not be recognized as two. |
trigger_create(_,clap,wait_a_second_buddy). | trigger_create(_,clap,wait_a_second_buddy). |
| |
trigger_create(_,clap,go_on_buddy). | trigger_create(_,clap,go_on_buddy). |
| |
% Sprawdzenie, czy natężenie dźwięku przekracza progową wartość. | % Verifying if the sound intensity exceeds the threshold value. |
clap :- | clap :- |
nxt_sound(Value,force), | nxt_sound(Value,force), |
Value > 15. | Value > 15. |
| |
% Sprawdzenie, czy sensor dotyku jest wciśnięty. | % Verifying if the touch sensor is pressed. |
pushed :- | pushed :- |
nxt_touch(Value,force), | nxt_touch(Value,force), |
</code> | </code> |
| |
The robot moves forward. Stops after a clap. Moves farther after an another clap. | The robot moves forward. Stops after a clap. Moves farther after an another clap.\\ |
It stops and closes the connection after pressing touch sensor. | It stops and closes the connection after pressing touch sensor. \\ |
Choose a threshold for detecting a clap sound. | Choose a threshold for detecting a clap sound. \\ |
Too low value can cause a loop. | Too low value can cause a loop. \\ |
Too high will make you will have to punch the sensor instead of clapping. | Too high will make you will have to punch the sensor instead of clapping. |
| |