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.
Dependencies: FastPWM mbed QEI biquadFilter HIDScope MODSERIAL
main.cpp
- Committer:
- Ramonwaninge
- Date:
- 2018-09-25
- Revision:
- 4:0c27632b453a
- Parent:
- 3:d39285fdd103
- Child:
- 5:047db32db712
File content as of revision 4:0c27632b453a:
#include "mbed.h" #include "FastPWM.h" Ticker motor; FastPWM pin5(D5); AnalogIn pot1(A1); //AnalogOut pot2(A2); DigitalOut pin4(D4); //float u = pot1; void draai(){ float u = pot1; //if (u>0){ // pin4 = true; // } // else if(u<0){ // pin4 = false; // } pin4 = true;// u > 0.0f; pin5 = fabs(u); } int main(){ pin5.period_us(60); motor.attach(draai, 0.001); while(true){ } }