EasyManuals Logo

Arduino uno User Manual

Arduino uno
311 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #243 background imageLoading...
Page #243 background image
Heres a picture of a servo motor connected to an Arduino using wires. You
can also use pin headers, but wires give you more flexibility.
Controlling servo motors is convenient, because you can set the motors shaft
to an angle between 0 and 180. With the following sketch, you can send a
degree value via the serial port and move the servo motor accordingly:
Motors/SerialServo/SerialServo.ino
#include <Servo.h>
Line 1
-
const unsigned int MOTOR_PIN = 9;
-
const unsigned int MOTOR_DELAY = 15;
-
const unsigned int SERIAL_DELAY = 5;
5
const unsigned int BAUD_RATE = 9600;
-
-
Servo servo;
-
-
void setup() {
10
Serial.begin(BAUD_RATE);
-
servo.attach(MOTOR_PIN);
-
delay(MOTOR_DELAY);
-
servo.write(1);
-
delay(MOTOR_DELAY);
15
}
-
-
Chapter 13. Controlling Motors with Arduino 228
report erratum discuss
www.it-ebooks.info

Table of Contents

Other manuals for Arduino uno

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Arduino uno and is the answer not in the manual?

Arduino uno Specifications

General IconGeneral
Form factorArduino
CertificationRoHS, FC, CE
Processor model-
Processor frequency- MHz
Microcontroller modelATmega328
Microcontroller frequency16 MHz
DC input voltage7-12 V
Operating voltage5 V
DC current per I/O pin40 mA
Flash memory0.032 MB
Maximum internal memory- GB
SRAM (Static Random Access Memory)2 KB
EEPROM (Electrically Erasable Programmable Read-Only Memory)1 KB
Wi-FiNo
Number of analog I/O pins6
Number of digital I/O pins14
Weight and Dimensions IconWeight and Dimensions
Board dimensions53.4 x 68.6 mm

Related product manuals