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

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

Using Arduino Uno R3 to bootload the atmega328-PU (non pico)

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??