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: mbed
main.cpp
- Committer:
- henriquer
- Date:
- 2020-10-15
- Revision:
- 0:4c1209865a22
File content as of revision 0:4c1209865a22:
// IHM04A1 - Controle motor DC - Potenciometro// #include "mbed.h" DigitalIn bt (USER_BUTTON); DigitalOut IN1B (D5); DigitalOut IN2B (D4); PwmOut ENB (D2); //DigitalOut ENB (D2); AnalogIn pot (A5); Serial pc(USBTX, USBRX); float val_pot; int main() { pc.baud(9600); while(1) { float dutyENB = val_pot; // Função duty -Tempo de trabablho val_pot = pot.read(); pc.printf("%1.2f\n\r",val_pot); ENB.write(dutyENB); IN1B = 0; IN2B = 1; wait_ms(500); } }