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.
Mot_inter.cpp
00001 #include "Mot_inter.h" 00002 #include "mbed.h" 00003 00004 Mot_inter::Mot_inter(PinName pin1, PinName pin2, PinName tipka1, PinName tipka2):C(tipka1),D(tipka2) 00005 { 00006 A = new PwmOut(pin1); 00007 B = new PwmOut(pin2); 00008 C.mode(PullUp); 00009 D.mode(PullUp); 00010 C.rise(this, &Mot_inter::pritisnuto); 00011 D.rise(this, &Mot_inter::pritisnuto); 00012 } 00013 00014 void Mot_inter::naprijed() 00015 { 00016 A->write(1); 00017 B->write(0); 00018 } 00019 00020 void Mot_inter::natrag() 00021 { 00022 A->write(0); 00023 B->write(1); 00024 } 00025 00026 void Mot_inter::stop() 00027 { 00028 A->write(0); 00029 B->write(0); 00030 } 00031 00032 void Mot_inter::pritisnuto() 00033 { 00034 stop(); 00035 }
Generated on Fri Jul 15 2022 21:05:27 by
1.7.2