![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Potmeter FastPWM.h
main.cpp
- Committer:
- vd
- Date:
- 2017-09-19
- Revision:
- 0:16be67f4d9ac
File content as of revision 0:16be67f4d9ac:
#include "mbed.h" #include "FastPWM.h" //DigitalOut gpo(D0); //DigitalOut ledr(D8); //PTA0 doesn't work DigitalOut ledl(D9); DigitalIn but1(D6); //D6 DigitalIn but2(D7); // Don't use D8 AnalogIn potmeter(A0); FastPWM ledr(D3); float PwnPeriod = 1.0/5000.0; int main() { ledr.period(PwnPeriod); while (true) { // gpo = !gpo; // toggle pin // led = !led; // toggle led ledr = potmeter.read(); wait(0.1f); //ledr = 0; //if (but1 == false) { //ledr = !ledr; //} //if (but2 == false) { //ledl = !ledl; //} } }