LAB09_Oppgave1

Dependencies:   mbed

Fork of LAB08_Oppgave3 by Morten Madsen

main.cpp

Committer:
madmonkeyman82
Date:
2015-10-29
Revision:
3:8a79c1dcefaa
Parent:
2:0dcac9edd3dc

File content as of revision 3:8a79c1dcefaa:

#include "mbed.h"

PwmOut servoMotor(PA_7);
AnalogIn pot(PA_1);
DigitalOut vcc(PA_0);
DigitalOut gnd(PA_4);

int main() 
{    //sørg for å at servoMotor pulsen har en 
    //      Periode tid på .01 sek
    vcc=1;
    gnd=0;
    
    servoMotor.period(0.010);
    
    while (true) 
    {
          servoMotor = pot.read();
           wait_ms(5);
    }
}