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.
HBridgeMotor.cpp
00001 #include "HBridgeMotor.h" 00002 00003 HBridgeMotor::HBridgeMotor(PinName fin, PinName rin):fwd(fin), rev(rin) { 00004 power = 0.0; 00005 } 00006 00007 void HBridgeMotor::set(float power) { 00008 if(power >= 0.0) { 00009 rev = 0.0; 00010 fwd = power; 00011 } else { 00012 rev = -power; 00013 fwd = 0.0; 00014 } 00015 } 00016 00017 float HBridgeMotor::read() { 00018 return power; 00019 }
Generated on Sat Jul 16 2022 03:54:56 by
1.7.2