Goutami Bhat
/
DCmotor
DCmotor rotation depends on pin switch
Fork of HelloWorld by
Embed:
(wiki syntax)
Show/hide line numbers
DCmotor.cpp
00001 #include "Dcmotor.h" 00002 #include "mbed.h" 00003 00004 Dcmotor::Dcmotor(PinName1 pin1,PinName2 pin2) : pins(pin1,pin2) { 00005 pins = 0; 00006 } 00007 00008 void Dcmotor::Dc() { 00009 if(pinnm==0) 00010 { 00011 pins=1; 00012 wait(0.2); 00013 } 00014 if(pinnm==1) 00015 { 00016 pins=2; 00017 wait(0.2); 00018 } 00019 }
Generated on Fri Jul 15 2022 01:49:31 by 1.7.2