znrobotics 智能工场 / Mbed 2 deprecated Seeed_Arch_link_Servo

Dependencies:   Servo mbed

Fork of Program3_Servo by Robotics Kit Workshop

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"   // this tells us to load mbed related functions
00002 #include "Servo.h"  // library for the Servo
00003 
00004 Servo myservo(p10);
00005 
00006 // this code runs when the microcontroller starts up
00007 int main() {    
00008     for(float p=0; p<1.0; p += 0.1) {
00009         myservo = p;
00010         
00011         wait(0.2);
00012         // YOUR CODE HERE : make code run between 0-1 only!
00013     }
00014 }