Skip to content

Instantly share code, notes, and snippets.

@RobolinkAkademi
Last active November 5, 2019 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobolinkAkademi/34639044e74fbef63540b92a30560251 to your computer and use it in GitHub Desktop.
Save RobolinkAkademi/34639044e74fbef63540b92a30560251 to your computer and use it in GitHub Desktop.
Obstructing Example.ino
#include <dmoto.h>
dmoto obstacle;
void setup()
{
Serial.begin(9600);
obstacle.pinSet();
obstacle.Stop();
}
void loop() {
Serial.println(obstacle.distance());
if (obstacle.distance() < 15)
{
obstacle.Backward(150);
delay(150);
obstacle.Right(0,150);
delay(250);
}
else
{ obstacle.Forward(150);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment