Simply creates a servo object from a motor object, to allow the control of the angle.

Dependencies:   mbed

Fork of Lab5_Basic by ziad eldebri

main.cpp

Committer:
dogcatfee
Date:
2017-11-03
Revision:
12:988fb6ffae63
Parent:
9:e2909d7f36b8

File content as of revision 12:988fb6ffae63:

#include "mbed.h"
#include "Motor.h"
#include "Servo.h"
/************************************* Lab5 Motor to servo     ***************************/
/*                                                                                      */
/*  File: main.cpp                                                                      */
/*  Author: Ziad Eldebri                                                                */
/*  Date Created: 8/19/2016                                                             */
/*  Description:              */
/*                                                                                      */
/****************************************************************************************/
// Edit ~ Matthew Sessions

//               A    Digi  Digi  PWM
//Servo my_servo(PTB3,PTE19,PTE18,PTE31);
Servo my_servo(PTB3,PTB0,PTB1,PTE29);

int main()
{
      for(int i = 10 ; i < 100; i+=5 )
      {
        my_servo.set(i);
        wait(4);
      }
}