yilmazyurdakul
Published

Universal Steering Controls

Better driving experience for even Lada Niva :)

AdvancedFull instructions provided323

Things used in this project

Hardware components

Arduino Pro Mini 328 - 5V/16MHz
SparkFun Arduino Pro Mini 328 - 5V/16MHz
×1
Infrared Emitter, 15 °
Infrared Emitter, 15 °
×1
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×1
Capacitor 470 µF
Capacitor 470 µF
×1
Switch Actuator, Head for spring return push-button
Switch Actuator, Head for spring return push-button
×1
Linear Regulator (7805)
Linear Regulator (7805)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Arduino IDE Codes

Arduino
Just edit bit length and codes
long buttonTimer = 0;
long longPressTime = 500;
boolean buttonActive = false;
boolean longPressActive = false;

long buttonTimer2 = 0;
long longPressTime2 = 500;
boolean buttonActive2 = false;
boolean longPressActive2 = false;

#include <IRremote.h>
IRsend irsend;

#define lUp 4
#define lDown 5
#define rUp 2
#define rDown 7

#define volDown 0xFDB04F
#define volUp 0xFDA857
#define prev 0xFD08F7
#define nxt 0xFD48B7
#define play 0xFD9867
#define mute 0xFD28D7

void setup()
{
  
  pinMode(lUp, INPUT_PULLUP);
  pinMode(lDown, INPUT_PULLUP);
  pinMode(rUp, INPUT_PULLUP);
  pinMode(rDown, INPUT_PULLUP);
}

void loop() {

  if (digitalRead(rDown) == LOW) {
    if (buttonActive == false) {
      buttonActive = true;
      buttonTimer = millis();
    }
    if ((millis() - buttonTimer > longPressTime) && (longPressActive == false)) {
      longPressActive = true;
      //Uzun basma
      irsend.sendNEC(mute, 32);
      delay(100);
    }
  } else {
    if (buttonActive == true) {
      if (longPressActive == true) {
        longPressActive = false;
      } else {
        //kısa basma
        irsend.sendNEC(volDown, 32);
        delay(100);
      }
      buttonActive = false;
    }
  }
  /* --------------------------------------------------------------------------------------------------------*/
  if (digitalRead(rUp) == LOW) {
    if (buttonActive2 == false) {
      buttonActive2 = true;
      buttonTimer2 = millis();
    }
    if ((millis() - buttonTimer2 > longPressTime2) && (longPressActive2 == false)) {
      longPressActive2 = true;
      //Uzun basma
      irsend.sendNEC(play, 32);
      delay(100);
    }
  } else {
    if (buttonActive2 == true) {
      if (longPressActive2 == true) {
        longPressActive2 = false;
      } else {
        //kısa basma
        irsend.sendNEC(volUp, 32);
        delay(100);
      }
      buttonActive2 = false;
    }
  }
  /* --------------------------------------------------------------------------------------------------------*/

  if (digitalRead(lUp) == LOW) {
    irsend.sendNEC(prev, 32);
    delay(200);
  }

  if (digitalRead(lDown) == LOW) {
    irsend.sendNEC(nxt, 32);
    delay(200);
  }


}

Credits

yilmazyurdakul

yilmazyurdakul

9 projects • 23 followers

Comments