Arduino Product Display
Have you ever seen product rotating on its own ???Yes, today we are creating the same product displayed using simple item i.e a servo motor and Arduino.I forgot to introduce myself, I'm Gokul.I have said you initially what's today project we are about to deal now.Let's now get Components required to make this ibles .
Components Required
components required are as above:
- Arduino
- Servo
- Knife
- cardboard
- tape
Servo Connection
servo connection is a type of motor that is used to control the angular rotation and speed of the rotating shaft.
Here Servo is connected is as follow:
- The VCC pin or red wire is connected to the 5v pin on the Arduino Uno.
- The GND pin or the maroon wire is connected to the GND pin of the Arduino Uno.
- The signal wire or the orange wire is connected to the digital pin of 3 of Arduino Uno.
Cutting and Fixing
cut a cardboard into circle or any of shape as you wish to.Then place your horn on the cardboard,Then stick the horn on the cardboard using a tape or hot glue.
Coding
#include "Servo.h"
Servo myservo; // create servo object to control a servo // twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() { myservo.attach(7); // attaches the servo on pin 9 to the servo object }
void loop() { for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } }