Let's Make Robots!

servo

I tried to write a code but the servo would not stay so

Please can someone write a c++ code for arduio for me

ultrasonic sensor

i just got an ultrasonic sensor with 4 pins of ench pin it has

1.VCC

2.Trig

3.Echo

4.GND ( already know )

 

what do they mean?

Object avoidance with the Ultrasonic sensor

I am making a robot using arduino and i need an easy object avoidance code

Here is what i found:

 

 

#include "URMSerial.h"

 

#include <Servo.h>

Servo lservo;

Servo rservo;

// The measurement we're taking

#define DISTANCE 1

#define TEMPERATURE 2

#define ERROR 3

#define NOTREADY 4

 

int ledPin = 13; 

URMSerial urm;

 

void setup() {

  Serial.begin(9600); // Sets the baud rate to 9600