Servo beweging

Dependencies:   Servo mbed

main.cpp

Committer:
s1725696
Date:
2018-10-31
Revision:
1:9b3491c0f6b8
Parent:
0:01afb35ba995

File content as of revision 1:9b3491c0f6b8:

#include "mbed.h"
#include "Servo.h"

//Ticker servo;
//void signal_servo(){}

/* AL GEIMPLENTEERD IN THE_CODE, DUS VERANDER DAAR WAT JE HIER OOK VERANDERT A.U.B.!!!*/

Servo myservo(D7);
DigitalIn but_1(SW2);

void servocontrol()
{
    if (but_1)
    {
            myservo = 0.1;
        }
    else 
    {
            myservo = 0.0;
        } 
}
 
int main() 
{
    while (1)
    {
        servocontrol();
    wait(0.01);
    }   
}