Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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);
}
}