I am currently working on a project for uni where I am making a bubble machine;
I have found the coding online and I am using an Arduino Uno board but when I try using the coding, I get the following error:
"Error compiling for board Arduino/Genuino Uno."
Any ideas as to what the issue could be?
Here is the code:
#include <AFMotor.h>
#include <Servo.h>
Servo panServo;
Servo tiltServo;
AF_DCMotor motor(4, MOTOR12_1KHZ); // create motor #4, 1 KHZ
byte pos = 0; // variable to store starting servo position
void setup() {
 panServo.attach(9); //pan servo on pin 9
 tiltServo.attach(10); //tilt servo on pin 10
 panServo.write(90); //added this for second sketch
 tiltServo.write(90); // hoping to halt wild start up swing
 motor.setSpeed(230); // set dc motor speed to 254 of 0-255 range
}
void loop() {
 for(pos = 0; pos < 180; pos += 1) { //servo moves 0 degrees to 180 degrees in steps of 1 degree
  panServo.write(pos); // tell servo to go to position in variable 'pos'
  delay(15);
 }
 for(pos = 0; pos < 90; pos += 1) { //tilt servo moves 45 degrees down
  tiltServo.write(pos);
  delay(15); // waits 15ms for servo to reach 90 degrees
  //delay(500); // holds in bubble solution half second
 }
 for(pos = 90; pos >= 1; pos -= 1) { // tilt servo raises and levels off
  tiltServo.write(pos);
  delay(15);
 }
 for(pos = 180; pos >=1; pos -= 1) { // pan servo swings wand around towards fan
  panServo.write(pos);
  delay(15);
 }
 motor.run(FORWARD); //turn on dc motor
 delay(3000); // pan servo hold at fan for a couple of seconds
 Servo refresh(); //refresh and begin again
 motor.run(RELEASE); // dc motor to stop
}
There is absolutely no way we can help you based on such an incredibly vague description. Do you see that black console window at the bottom of the Arduino IDE window? Scroll all the way to the top of that window and read the actual error messages you will find there. That's the important information for troubleshooting.
When you encounter an error you'll see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).
Sorry, its the first time I am posting on this forum so I am unsure how it works..
Here is the error:
Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Arduino/Genuino Uno"
C:\Users\laure\Documents\Arduino\sketch_mar30a\sketch_mar30a.ino:1:21: fatal error: AFMotor.h: No such file or directory
#include <AFMotor.h>
          ^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Now the next step is normally to provide some details of exactly what components you are using and a circuit diagram showing how they are connected and particularly how everything is powered.
But first...are you definitely using the (ancient) Adafruit Motor Shield Version 1, which is what that particular library is intended for?
If you're trying to run everything from that weedy little 9V battery then that's your problem. They can't supply enough current for a motor. And the motor and servos should be powered separately never from the Arduino power pin.
The 9V battery may just run the Arduino on it's own. Rechargeable AA batteries work a lot better for motors and servos.