 Button::Button(byte pin, byte timeButton) {
   _pin= pin;
   _timeButton= timeButton;
-  pinMode(_pin, INPUT);  
+  //pinMode(_pin, INPUT);  
 }
 
 

//Setup method
void setup() {
  // Initializing pins modes
  pinMode(S0, OUTPUT);
  pinMode(S1, OUTPUT);
  pinMode(S2, OUTPUT);
  pinMode(S3, OUTPUT);
  //DDRB = B01111000;
  pinMode(scanSensor, INPUT);

  //Attaching the motors
  Motor1.attach(rotateMotorPin);


//Method from class Button to perform digital debouncing
void Button::filterAvarage() {
  //if (flagPress != !digitalRead(_pin) ) {
  if (flagPress != !bitRead(PIND, _pin)) {  
    if ( _buttonCount != 0 ) _buttonCount--;
    }
  else {
