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.
L298HBridge.cpp
00001 #include "L298HBridge.h" 00002 #include "mbed.h" 00003 00004 L298HBridge::L298HBridge(PinName ENpin, PinName FWDpin, PinName REVpin) : _en(ENpin), _fwd(FWDpin), _rev(REVpin) 00005 { 00006 _fwd = 0; 00007 _rev = 0; 00008 _en = 0.0; 00009 } 00010 00011 void L298HBridge::Fwd() 00012 { 00013 _fwd = 1; 00014 _rev = 0; 00015 } 00016 00017 void L298HBridge::Rev() 00018 { 00019 _fwd = 0; 00020 _rev = 1; 00021 } 00022 00023 void L298HBridge::Stop() 00024 { 00025 _fwd = 1; 00026 _rev = 1; 00027 } 00028 00029 00030 00031 void L298HBridge::SetSpeed(float PWMPercentage) 00032 { 00033 _en = PWMPercentage; 00034 } 00035
Generated on Thu Jul 14 2022 15:57:24 by
1.7.2