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:
- Nicolaemf
- Date:
- 2018-10-31
- Revision:
- 11:5e955cf303ab
- Parent:
- 6:b476699ac7d4
File content as of revision 11:5e955cf303ab:
#include "mbed.h" Serial pc(USBTX, USBRX); // tx, rx PwmOut myled(LED1); PwmOut motorRight(PTD0); PwmOut motorLeft(PTD5); //PwmOut pwm1(PTD0); AnalogIn potInput(PTB0); float storeInput; int main() { myled = 0.1; while(1) { myled = myled + 0.1; if(myled >= 1){ myled = 0; } storeInput = potInput.read(); motorRight = storeInput; motorLeft = (storeInput * -1.0) + 1.0; pc.printf("%f\n", storeInput); wait(0.1); } }