Dependents:   ShootingSystem

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers AmmoPusher.cpp Source File

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 }