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.
motordc3.cpp
00001 #include "mbed.h" 00002 AnalogIn pot(PTB3); 00003 PwmOut motordc(PTD4); 00004 DigitalIn boton(PTB2); 00005 DigitalOut IN1(PTD0); 00006 DigitalOut IN2(PTD5); 00007 DigitalOut myled(LED1); 00008 00009 int main() { 00010 00011 myled=0; 00012 wait(0.5); 00013 myled=1; 00014 00015 00016 while(1) { 00017 00018 00019 if(boton==1){ 00020 float input = pot; 00021 motordc = input; 00022 IN1=1; 00023 IN2=0; 00024 wait(0.1); 00025 } else if(boton==0){ 00026 float input = pot; 00027 motordc = input; 00028 IN1=0; 00029 IN2=1; 00030 wait(0.1); 00031 00032 } 00033 } 00034 }
Generated on Wed Jul 27 2022 09:16:47 by
1.7.2