aa

Dependencies:   mbed

Input/Switch/Switch.cpp

Committer:
M_souta
Date:
2019-01-28
Revision:
0:2e7a61458dc3
Child:
1:e1e9671724e7

File content as of revision 0:2e7a61458dc3:

#include "Switch.h"
#include <stdint.h>

DigitalIn limitSw[] = {
    DigitalIn(LIMITSW0_PIN),
    DigitalIn(LIMITSW1_PIN),
    DigitalIn(LIMITSW2_PIN),
    DigitalIn(LIMITSW3_PIN),
};

namespace SWITCH 
{
    void Switch::Initialize(void){
        for(int i = 0 ; i < MOUNTING_LIMITSW_NUM; i++){
            limitSw[i].mode(PullUp);
        }
    }
    
    bool Switch::CheckPushed(int SwitchNumber){
        return SwitchNumber ? false : true ;
    }
}