This program uses the potentiometers to set the servo positions. Note that it will need additional power (6v) that can be supplied through the 1.3mm tip-positive DC conenctor

Dependencies:   Servo mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "Servo.h"
00003 
00004 Servo s1(p21);
00005 Servo s2(p22);
00006 
00007 AnalogIn p1(p19);
00008 AnalogIn p2(p20);
00009 
00010 int main() {
00011     while(1) {
00012         s1=p1;
00013         s2=p2;        
00014         wait(0.1);
00015     }
00016 }