Embed:
(wiki syntax)
Show/hide line numbers
AmmoPusher.cpp
00001 #include "AmmoPusher.h" 00002 #include "mbed.h" 00003 #include "I2CMotor.h" 00004 #include "I2CDevice.h" 00005 00006 AmmoPusher::AmmoPusher( char address ) : I2CDevice( address ){ 00007 mState = BETWEEN; 00008 mActionType = NO_OPERATION; 00009 } 00010 00011 int AmmoPusher::write(){ 00012 char buf = mActionType; 00013 return I2CDevice::write( &buf, 1 ); 00014 } 00015 00016 int AmmoPusher::read(){ 00017 char buf; 00018 int val = I2CDevice::read( &buf, 1 ); 00019 mState = static_cast< State >( buf ); 00020 return val; 00021 }
Generated on Thu Jul 14 2022 05:47:12 by 1.7.2