|
|
pl:mindstorms:studenci:przedmioty:jsi:jsi2008:jsi20090121-08d [2009/01/27 12:06] jsi08 utworzono |
pl:mindstorms:studenci:przedmioty:jsi:jsi2008:jsi20090121-08d [2019/06/27 15:50] |
?- [demos/demo2]. | |
% threads compiled into threads 0.00 sec, 8,216 bytes | |
% nxt_sensomoto compiled into nxt_sensomoto 0.00 sec, 21,744 bytes | |
% lib/nxt_movement compiled into nxt_movement 0.00 sec, 36,820 bytes | |
% lib/nxt_actions_serial compiled into nxt_actions_serial 0.01 sec, | |
33,460 bytes | |
% ../plnxt compiled 0.01 sec, 72,388 bytes | |
% demos/demo2 compiled 0.01 sec, 74,576 bytes | |
| |
Yes | |
?- start. | |
| |
Yes | |
?- Warning: [Thread 4] Thread running "trigger_start(check_distance, | |
wall, 1)" died on exception: Out of global stack | |
| |
Action (h for help) ? abort | |
ERROR: Execution Aborted | |
% Execution Aborted | |
?- nxt_close. | |
| |
No | |
?- halt. | |
1 threads wouldn't die | |
student@robo2:~/plnxt$ ./bin/plnxt_stty irek | |
Setting device configuration (pairing may be needed)... | |
DONE! | |
student@robo2:~/plnxt$ pl | |
Welcome to SWI-Prolog (Multi-threaded, Version 5.4.7) | |
Copyright (c) 1990-2003 University of Amsterdam. | |
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, | |
and you are welcome to redistribute it under certain conditions. | |
Please visit http://www.swi-prolog.org for details. | |
| |
For help, use ?- help(Topic). or ?- apropos(Word). | |
| |
?- [ | |
Action (h for help) ? | |
| |
| |
| |
| |
| |
| |
------test2.pl------------------------------------- | |
:- consult('../plnxt.pl'). | |
| |
jedz_po_cole :- | |
nxt_go(200), | |
trigger_create(_,not(check_light),[nxt_stop,nxt_rotate(200,20),jedz_po_cole]). | |
trigger_create(_,check_touch,[nxt_stop,nxt_close]), | |
nxt_close. | |
| |
check_sound :- | |
nxt_sound(Value,force), | |
Value > 50. | |
| |
check_touch :- | |
nxt_touch(Value,force), | |
Value < 50. | |
| |
check_light :- | |
nxt_light(Value,force), | |
Value < 28. | |
| |
start :- | |
nxt_open, | |
nxt_go(400), | |
trigger_create(_,check_sound,[nxt_stop,nxt_close]), | |
trigger_create(_,check_light,[nxt_stop,jedz_po_cole]). | |
% nxt_close. | |
| |
:- start. | |