Last active
June 13, 2023 11:07
-
-
Save kazemito/5b9b6ea980c27f60b6d9f68592b36589 to your computer and use it in GitHub Desktop.
Arduino Quick Shifter without Display and Need to Reupload the code if you want to adjust the values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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