I’m new at all things coding, so please respond as if it were to a 1st grader. Since I’m so new, I include a bunch of notes at the beginning of my code so I can come back later and still understand, so feel free to skip over all of that. Also, on the bottom of the code, I was working on the next step but it’s commented out so I don’t think it should be interfering with the program.
I’m getting an error message that says that multiple libraries found. I’m not sure where to go to uninstall a library.
/*Code Purpose Statement
// This code is used for the ultrasonic
// sensor and servo motor attached to the
// Hummer-bot.
// What: I want the hummer-bot to drive
// around the room utilizing it's
// installed ultrasonic sensor to
// avoid obstacles.
// How: I'm going to program the hummer
// bot to constantly send a sonic
// pulse into the room and when the
// wave returns at a certian distance
// then the hummer-bot will engage
// the servo motor to look both ways
// and then decide to continue travel
// in the direction that has the most
// available space.
*/
/*Ultrasonic Sensor Servo Centering.
// The following portion of code is designed for centering the
// servo motor.
// As soon as the servo motor is centered, this portion of the
// coding can be commented out. (lines 20 - 45)
// (#include <Servo.h>) tells the program to include the servo
// library. (Servo usservo) tells the program that I would like
// to name the servo under the ultrasonic sensor 'usservo'
//
// inside void setup()
// (usservo.attach(13)) tells the board that the servo motor
// is attached to pin 13 on the sensor shield.
*/
#include <Servo.h>
Servo usservo;
void setup() {
usservo.attach(13);
// move the servo to center position (90 degrees)
usservo.write(90);
}
/*Obstacle Avoidance Using Ultrasonic Sensor Coding.
// The following code is for utilizing the ultrasonic sensors
// on the hummer-bot for avoiding obstacles.
//
// (#include <Servo.h>) tells the program to include the servo
// library. (Servo usservo) tells the program that I would like
// to name the servo under the ultrasonic sensor 'usservo'
*/
/*
#include <Servo.h>
Servo usservo;
int Echo = D2;
int Trig = D3;
#define ENA 5
#define ENB 6
#define IN1 7
#define IN2 8
#define IN3 9
#define IN4 11
#define carSpeed 150
void setup () {
}
void loop() {
}
*/
Thanks