initial commit

Dependencies:   mbed

Fork of empc_pdu_v3 by gami

SWITCH.cpp

Committer:
rcflyair
Date:
2017-04-07
Revision:
1:1686fedb8e0a

File content as of revision 1:1686fedb8e0a:

#include "SWITCH.h"

SWITCH::SWITCH(PinName sw0, PinName sw1, PinName sw2, PinName sw3) : _sw0(sw0), _sw1(sw1), _sw2(sw2), _sw3(sw3)
{
    
}    

int SWITCH::GetMode(void)
{
    if (!_sw0.read()) return 1;
    if (!_sw1.read()) return 2;
    return 0;
}

int SWITCH::GetMove(void)
{
    if (!_sw2.read()) return 1;
    if (!_sw3.read()) return 2;
    return 0;
}