Ask Physics Expert

OVERVIEW

In this activity, you will control the servo motor provided along with the 321Maker shield.

OUTCOMES
By the end of this assignment you will be able to:
- Use Servo library to control micro servo.
- Control servo using input devices.

REQUIREMENTS
- Arduino-Compatible board
- 321Maker shield
- USB Cable
- Arduino Software
- SG90 9 g Micro Servo
- Account on a Git repository hosting service

BACKGROUND

"Servos have integrated gears and a shaft that can be precisely controlled. Standard servos allow the shaft to be positioned at various angles, usually between 0 and 180 degrees.".

LEVEL 1: SETUP
- Create a new source code repository on your GitLab account. Use the starter code repository as your starting point.
- Open Visual Studio Code.
- Clone the repository into your local hard drive.
- Select file servoControl.ino.
- Connect your servo motor to the 321Maker shield as follows: Connect the devices as follows.
321Maker Servo GND ----------- GND
VCC ----------- VCC
D9 ----------- Pulse
- Connect the Arduino to your computer using the USB port.
- Make sure you select the correct Arduino board and communications port (don't forget to set bound rate).
- Make sure the code uses the correct pin, change it if necessary.
- Fix code so that it complies with servo specification:
- Verify that code compiles without error.
- Upload program to Arduino board.
- Congratulations, your should see the servo motor sweep side to side.
- Demo to your instructor

LEVEL 2: PROGRAM MODIFICATION
- Implement knob functionality using the 321Maker rotation sensor. You probably want to use the map function.
- Commit changes.
- Demo to your instructor

LEVEL 3: ADVANCED
- Add code so that servo also rotates depending on the button pressed. Button 1 should move the servo to the left (1 degree at a time). Button 2 should rotate the servo to the right (1 degree at a time).
- Commit changes.
- Demo to your instructor
- Change code so that it uses the buzzer to indicate that the servo has reached its maximum rotation angle.
- Commit changes
- Demo to your instructor

Attachment:- Visual Studio Code.rar

Physics, Academics

  • Category:- Physics
  • Reference No.:- M92534176

Have any Question?


Related Questions in Physics

Question oppositely charged parallel plates are separated

Question: Oppositely charged parallel plates are separated by 5.31 mm. A potential difference of 600 V exists between the plates. (a) What is the magnitude of the electric field between the plates? N/C (b) What is the ma ...

Question an object of mass m attached to a spring of force

Question: An object of mass m attached to a spring of force constant k oscillates with simple harmonic motion. The maximum displacement from equilibrium is A and the total mechanical energy of the system is E. What is th ...

Quesion when a nucleus of 235u undergoes fission it breaks

Quesion: When a nucleus of 235U undergoes fission, it breaks into two smaller, more tightly bound fragments. Part A: Calculate the binding energy per nucleon for 235U. Express your answer with the appropriate units. E=__ ...

Question a nylon rope used by mountaineers elongates 130 m

Question: A nylon rope used by mountaineers elongates 1.30 m under the weight of a 65.0-kg climber. If the rope is 45.0 m in length and 7.0 mm in diameter, what is Young's modulus for this material? The response must be ...

Question an object is 30 cm in front of a converging lens

Question: An object is 30 cm in front of a converging lens with a focal length of 10 cm. Use ray tracing to determine the location of the image. What are the image characteristics: (i) upright or inverted, (ii) magnifica ...

Question an object of mass m is traveling on a horizontal

Question: An object of mass m is traveling on a horizontal surface. There is a coefficient of kinetic friction µ between the object and the surface. The object has speed v when it reaches x=0 and encounters a spring. Th ...

Question in one of the classic nuclear physics experiments

Question: In one of the classic nuclear physics experiments at the beginning of the 20th century, an alpha particle was accelerated towards a gold nucleus and its path was substantially deflected by the Coulomb interacti ...

Question an object of mass m is dropped from height h above

Question: An object of mass m is dropped from height h above a planet of mass M and radius R. Find an expression for the object's speed as it hits the ground. Express your answer in terms of the variables m,M,h,R and app ...

Question one type of bb gun uses a spring-driven plunger to

Question: One type of BB gun uses a spring-driven plunger to blow the BB from its barrel. (a) Calculate the force constant of its plunger's spring if you must compress it 0.130 m to drive the 0.0580-kg plunger to a top s ...

Question an object is placed 30 cm to the left of a

Question: An object is placed 30 cm to the left of a converging lens that has a focal length of 15cm. Describe what the resulting image look like (i.e. image distance, magnification, upright or inverted images, real or v ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As