Livejournal
Log in
Post
Friends
My journal
goofy4jah
OMFG!!! ROBOTICS!!!!
Jul 04, 2006 15:16
task main (
Read more...
)
Leave a comment
Comments 2
(The comment has been removed)
I HAVE UPDATED MY ROBOT CODING!!!
goofy4jah
July 6 2006, 00:13:21 UTC
int MOVE_TIME=200;
int TURN_TIME=50;
task main()
{
start sensor;
start move_robot;
Off(OUT_A+OUT_C);
}
task sensor()
{
SetSensor(SENSOR_1,SENSOR_TOUCH);
while(true)
{
if (SENSOR_1==1)
{ stop move_robot;
OnRev(OUT_A+OUT_C);
Wait(100);
OnFwd(OUT_A);
OnRev(OUT_C);
Wait(100);
Off(OUT_A+OUT_C);
start move_robot;
}
}
}
task move_robot()
{
repeat(32)
{
OnFwd(OUT_A+OUT_C);
OnRev(OUT_C);
OnFwd(OUT_A);
Wait(TURN_TIME);
MOVE_TIME=MOVE_TIME+100;
TURN_TIME=TURN_TIME+50;
}
}
I'm starting to understand a little bit!
Reply
(The comment has been removed)
Re: I HAVE UPDATED MY ROBOT CODING!!!
goofy4jah
July 8 2006, 02:07:25 UTC
that would be a yes!
Reply
Leave a comment
Up
Comments 2
(The comment has been removed)
int TURN_TIME=50;
task main()
{
start sensor;
start move_robot;
Off(OUT_A+OUT_C);
}
task sensor()
{
SetSensor(SENSOR_1,SENSOR_TOUCH);
while(true)
{
if (SENSOR_1==1)
{ stop move_robot;
OnRev(OUT_A+OUT_C);
Wait(100);
OnFwd(OUT_A);
OnRev(OUT_C);
Wait(100);
Off(OUT_A+OUT_C);
start move_robot;
}
}
}
task move_robot()
{
repeat(32)
{
OnFwd(OUT_A+OUT_C);
OnRev(OUT_C);
OnFwd(OUT_A);
Wait(TURN_TIME);
MOVE_TIME=MOVE_TIME+100;
TURN_TIME=TURN_TIME+50;
}
}
I'm starting to understand a little bit!
Reply
(The comment has been removed)
Reply
Leave a comment