Wall sensing robot code help


i new arduino , code.

i'm trying students create wall sensing robot.  have 2 wheel robot chassis , ultrasonic ping sensor.  have coded have robot move forward , have ping sensor wired , running.  question writing if statement when sensor senses obstacle stop wheels, turn specific amount, , move forward again.  want learn how code , not copy , paste others although don't mind repurposing code, want learn.  can step step how write code above?
thanks

quote
my question writing if statement when sensor senses obstacle stop wheels, turn specific amount, , move forward again.

this seems such simple thing. have tried? results?

using if test:
if(dist < 10)
{
   // stuff here
}

stop:
  // depends on motor shield,
  // connections , how many
  // motors there , whether
  // braking needed

turn:
  // depends on motor shield,
  // connections

go:
  // depends on motor shield,
  // connections


Arduino Forum > Using Arduino > Project Guidance > Wall sensing robot code help


arduino

Comments

Popular posts from this blog

CS5 Adobe Media Encoder: Encode failed because the source duration is nil.

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support