Skip to main content

Posts

Showing posts with the label motors

Day 8: Intro to Data Structures | Servos and More Music

Lecture One Dimensional Arrays Arrays are a type of data structure that allows for working with a group of values using a single identifier.  Lab Servos Servos rotate to a particular angular position and stay there until told to move to a new position.  There are both standard and continuous rotation servos. Unmodified ones have a fixed range due to a potentiometer in line with the drive shaft that is used for reporting the present position. Servos are controlled by sending a pulse of a certain length; this length determines the position it will rotate to. However, in a continuous rotation servo, there is no potentiometer and the servo rotates continuously, and the pulse length determines the speed instead.  Servos draw a significant amount of current, typically more than an Arduino can supply, so it is best to use a separate power supply. Homework Hardware //Servo Potentiometer Control #include <Servo.h> const int SERVO=9; //Servo on...