Ethan Kee / Mbed 2 deprecated Lift_arm_demo_manual

Dependencies:   mbed Servo

main.cpp

Committer:
e93858ek
Date:
2021-06-09
Revision:
2:50449384c230
Parent:
1:40d2fd0b99e6

File content as of revision 2:50449384c230:

// Hello World to sweep a servo through its full range

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

Servo myservo(D2);
Servo myservo2(D3);

AnalogIn pot1(A5);
AnalogIn pot2(A0);

Serial pc(USBTX,USBRX);

int main() {    
    pc.printf("\nSetup Complete\n");
    while(1){
        double pot1_val = pot1.read();
        double pot2_val = pot2.read();
        myservo = pot1_val;
        myservo2=pot2_val;
        pc.printf("S1\tS2\n");
        pc.printf("%f\t%f\n", pot1_val, pot2_val);
    }
      
}