Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Arduino Quick Shifter without Display and Need to Reupload the code if you want to adjust the values
/*
* KazeShifter Arduino Adjustable Open Source Quick Shifter
* Copyright (c) Muhammad Tresna Mukti
* created by : Muhammad Tresna Mukti aka Kazemito Haruhi
* Last Updated : March 2, 2020 Indonesia Time (GMT+07:00)
*
* For more information about this code, Go to link below
* YouTube : https://www.youtube.com/c/KazemitoHaruhi/
* Instructables : https://www.instructables.com/member/TresNaa/
*/
int cutoff=70; // Set Engine Cutoff time (If you're using relay, do not set timing under 40ms)
int dly=0; // Set Delay time before next Upshift
int i=0;
void setup() {
pinMode(2, INPUT_PULLUP); // Sensor pin
pinMode(5, OUTPUT); // Relay Pin
pinMode(6, OUTPUT); // LED pin
digitalWrite(5, HIGH); // Set Relay on High State
digitalWrite(6, HIGH); // Turn on LED
}
void loop() {
int snsrstate=digitalRead(2);
if (snsrstate==HIGH) {
i=0;
delay(50);
}
if (snsrstate==LOW && i==0) {
i+=1;
digitalWrite(5, LOW);
digitalWrite(6, LOW);
delay(cutoff);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
delay(dly);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment