code with errors for motorcycle shifter

hi Arduino community!
I am new to arduino and trying to learn code but its a very slow and confusing process. i have found a very useful video online of a guy who has programmed his Arduino to work as a motorcycle quick shift and shared his code for everyone to use. im trying to program his code onto my UNO R3 but dont understand how to fix all the errors that pop up after i try to verify it. can anyone take a look at the code and see if they can copy and paste and verify it and send me a copy to try. below is the website link to the code as its too large to post in here. thanks

https://gist.github.com/KazemitoHaruhi/c1bf9a39a3472a8bbfe877458e7c1030

When you encounter an error you'll see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

Arduino: 1.8.6 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\nathi\Desktop\LiquidCrystal_V1.2.1\sketch_sep07b\sketch_sep07b.ino: In function 'void setup()':

sketch_sep07b:78:3: error: 'lcd' was not declared in this scope

   lcd.begin(16,2); 

   ^

sketch_sep07b:108:7: error: 'EEPROM' was not declared in this scope

   dly=EEPROM.read(256);

       ^

C:\Users\nathi\Desktop\LiquidCrystal_V1.2.1\sketch_sep07b\sketch_sep07b.ino: At global scope:

sketch_sep07b:218:2: error: expected initializer before 'unsigned'

  unsigned long saveMillis = millis();

  ^

sketch_sep07b:223:3: error: expected unqualified-id before 'if'

   if (set==3) {

   ^

sketch_sep07b:226:3: error: expected unqualified-id before 'if'

   if(saveMillis - prevMillisConf > saveInterval) {

   ^

exit status 1
'lcd' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

That error and that code don't match up... ::slight_smile:

Arduino: 1.8.6 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\nathi\Desktop\LiquidCrystal_V1.2.1\sketch_sep07b\sketch_sep07b.ino: In function 'void setup()':

sketch_sep07b:78:3: error: 'lcd' was not declared in this scope

   lcd.begin(16,2); 

   ^

sketch_sep07b:108:7: error: 'EEPROM' was not declared in this scope

   dly=EEPROM.read(256);

       ^

C:\Users\nathi\Desktop\LiquidCrystal_V1.2.1\sketch_sep07b\sketch_sep07b.ino: At global scope:

sketch_sep07b:218:2: error: expected initializer before 'unsigned'

  unsigned long saveMillis = millis();

  ^

sketch_sep07b:223:3: error: expected unqualified-id before 'if'

   if (set==3) {

   ^

sketch_sep07b:226:3: error: expected unqualified-id before 'if'

   if(saveMillis - prevMillisConf > saveInterval) {

   ^

exit status 1
'lcd' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

im not sure what to do from here then?

You need to either compile the code you posted the link to or else post the code you're compiling.

The error messages make it clear that you're compiling different code and we can't see that code so there's nothing we can do to help you.

/*

#include <EEPROM.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
//I2C pins declaration
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

int up=HIGH; // Don't Touch!
int dn=HIGH; // Don't Touch!
int cutoff=5; // Don't Touch!
int led=6; // Don't Touch!
int i=0; // Don't Touch!=
int n=1; // Don't Touch!
int dly=50; // Don't Touch!
int kill=65; // Don't Touch!
int set=0; // Don't Touch!
int maxKill=149; // Set Engine Max cutoff Time (milisecs) or just don't touch it!
int minKill=41; // Set Engine Min cutoff Time (milisecs) or just don't touch it!
int maxDly=499; // Set Engine Min delay Time (milisecs) or just don't touch it!
int minDly=51; // Set Engine Min delay Time (milisecs) or just don't touch it!
unsigned long prevMillisConf = 0; // Don't Touch!
const long saveInterval = 1700; // Set Timeout

byte logo_a[8] = {
B11100,
B11100,
B11100,
B11100,
B11101,
B11101,
B11100,
B11110,
};
byte logo_b[8] = {
B00111,
B01111,
B11110,
B11100,
B11000,
B10000,
B00000,
B00000,
};

byte logo_c[8] = {
B11111,
B11111,
B11111,
B11101,
B11100,
B00000,
B00000,
B00000,
};

byte logo_d[8] = {
B00000,
B00000,
B10000,
B11000,
B11100,
B11110,
B01111,
B00111,
};

byte blank[8] = {
0x1F,
0x1F,
0x1F,
0x1F,
0x1F,
0x1F,
0x1F,
0x1F,
};

when you "copy - paste" you cut some lines from the beginning

 /*
   * KazeShifter Arduino Adjustable Quick Shifter
   * Copyright (c) Muhammad Tresna Mukti
   * created by : Muhammad Tresna Mukti aka Kazemito Haruhi
   * Last Updated : April 22 2018 at 5:21PM Indonesia Time (GMT+07:00)
   *
   * You will need those Libraries :
   * Liquidcrystal_I2C v1.2.1 : http://tiny.cc/libLcdI2C
   * Wire                     : http://tiny.cc/libWire
   * 
   * For more information about this code, Go to link below
   * YouTube        : https://www.youtube.com/TresNaa
   * Instructables  : https://www.instructables.com/member/TresNaa/
  */
  
#include <EEPROM.h>
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

check that the three last lines above (ie : #include...) are in your program

this is the second half

void setup() {
Serial.begin(9600);
Serial.println("initializing");
lcd.begin(16,2);
lcd.backlight();
lcd.createChar (0, logo_a);
lcd.createChar (1, logo_b);
lcd.createChar (2, logo_c);
lcd.createChar (3, logo_d);
lcd.createChar (4, blank);
lcd.setCursor(0,0);
lcd.print(char(0));
lcd.setCursor(1,0);
lcd.print(char(1));
lcd.setCursor(0,1);
lcd.print(char(2));
lcd.setCursor(1,1);
lcd.print(char(3));
lcd.setCursor(2,0);
lcd.print("azemito");
lcd.setCursor(10,0);
lcd.print("Haruhi");
delay(500);
lcd.setCursor(3,1);
lcd.print("Quick Shifter");
pinMode(7, INPUT_PULLUP);
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(8, INPUT);
pinMode(cutoff, OUTPUT);
pinMode(led, OUTPUT);
digitalWrite(cutoff, LOW);
dly=EEPROM.read(256);
kill=EEPROM.read(257);
digitalWrite(led, HIGH);
Serial.println("Ready.");
delay(1500);
lcd.clear();
lcd.setCursor(3,0);
lcd.print("Ready");
delay(450);
lcd.setCursor(5,1);
lcd.print("To ");
delay(200);
lcd.print("Race!");
delay(500);
lcd.setCursor(0,0);
lcd.print(char(4));
delay(25);
lcd.setCursor(1,0);
lcd.print(char(4));
delay(25);
lcd.setCursor(2,0);
lcd.print(char(4));
lcd.setCursor(0,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(3,0);
lcd.print(char(4));
lcd.setCursor(1,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(4,0);
lcd.print(char(4));
lcd.setCursor(2,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(5,0);
lcd.print(char(4));
lcd.setCursor(3,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(6,0);
lcd.print(char(4));
lcd.setCursor(4,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(7,0);
lcd.print(char(4));
lcd.setCursor(5,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(8,0);
lcd.print(char(4));
lcd.setCursor(6,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(9,0);
lcd.print(char(4));
lcd.setCursor(7,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(10,0);
lcd.print(char(4));
lcd.setCursor(8,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(11,0);
lcd.print(char(4));
lcd.setCursor(9,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(12,0);
lcd.print(char(4));
lcd.setCursor(10,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(13,0);
lcd.print(char(4));
lcd.setCursor(11,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(14,0);
lcd.print(char(4));
lcd.setCursor(12,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(15,0);
lcd.print(char(4));
lcd.setCursor(13,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(16,0);
lcd.print(char(4));
lcd.setCursor(14,2);
lcd.print(char(4));
delay(25);
lcd.setCursor(15,1);
lcd.print(char(4));
delay(25);
lcd.setCursor(16,1);
lcd.print(char(4));
delay(100);
lcd.clear();
lcd.setCursor(5,1);
lcd.print("Ready.");
}

void loop() {
unsigned long saveMillis = millis();
int swstate=digitalRead(7);
int snsrstate=digitalRead(2);
int up=digitalRead(3);
int dn=digitalRead(4);
if (set==3) {
set=0;
}
if(saveMillis - prevMillisConf > saveInterval) {
if (n==0) {
n=1;
if (i==1) {
Serial.print("Disabled");
digitalWrite(led, LOW);
lcd.clear();
lcd.clear();
lcd.setCursor(4,0);
lcd.print("Disabled");
lcd.setCursor(1,1);
lcd.print("Clutch Pulled.");
delay(250);
}
if (i==0) {
lcd.clear();
lcd.setCursor(5,1);
lcd.print("Ready.");
Serial.println("Ready.");
}
}
}
if(saveMillis - prevMillisConf < saveInterval) {
n=0;
}
if (i==2) {
i=0;
}
if (dly>maxDly) {
dly=maxDly;
}
if (dly<minDly) {
dly=minDly;
}
if (kill>maxKill) {
kill=maxKill;
}
if (kill<minKill) {
kill=minKill;
}
if (up==LOW && dn==LOW) {
switch (set) {
case 0:
set+=1;
lcd.backlight();
lcd.clear();
lcd.setCursor(4,0);
lcd.print("Unlocked");
lcd.setCursor(4,1);
lcd.print("Setting.");
delay(550);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Delay Time: +");
lcd.setCursor(1,1);
lcd.print(dly);
lcd.setCursor(4,1);
lcd.print("ms");
lcd.setCursor(15,1);
lcd.print("-");
break;
case 1:
set+=1;
lcd.backlight();
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Cut-off Time: +");
lcd.setCursor(1,1);
lcd.print(kill);
lcd.setCursor(4,1);
lcd.print("ms");
lcd.setCursor(15,1);
lcd.print("-");
break;
case 2:
set+=1;
lcd.clear();
lcd.setCursor(5,0);
lcd.print("Locked");
lcd.setCursor(3,1);
lcd.print("and Saved.");
EEPROM.write(256, dly);
EEPROM.write(257, kill);
delay(500);
break;
}
}
if (up==LOW) {
if (set==1) {
lcd.backlight();
delay(100);
dly+=10;
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Delay Time: +");
lcd.setCursor(1,1);
lcd.print(dly);
lcd.setCursor(4,1);
lcd.print("ms");
lcd.setCursor(15,1);
lcd.print("-");
prevMillisConf = millis();
}
if (set==2) {
lcd.backlight();
delay(100);
kill+=1;
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Cut-off Time: +");
lcd.setCursor(1,1);
lcd.print(kill);
lcd.setCursor(4,1);
lcd.print("ms");
lcd.setCursor(15,1);
lcd.print("-");
prevMillisConf = millis();
}
}
if (dn==LOW) {
if (set==1) {
lcd.backlight();
delay(100);
dly-=10;
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Delay Time: +");
lcd.setCursor(1,1);
lcd.print(dly);
lcd.setCursor(4,1);
lcd.print("ms");
lcd.setCursor(15,1);
lcd.print("-");
prevMillisConf = millis();
}
if (set==2) {
lcd.backlight();
delay(100);
kill-=1;
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Cut-off Time: +");
lcd.setCursor(1,1);
lcd.print(kill);
lcd.setCursor(4,1);
lcd.print("ms");
lcd.setCursor(15,1);
lcd.print("-");
prevMillisConf = millis();
}
}
switch (swstate) {
case LOW:
if (i==0) {
i+=1;
Serial.print("Disabled");
digitalWrite(led, LOW);
lcd.clear();
lcd.clear();
lcd.setCursor(4,0);
lcd.print("Disabled");
lcd.setCursor(1,1);
lcd.print("Clutch Pulled.");
delay(250);
}
break;
case HIGH:
if (i==1) {
i+=1;
Serial.println("Enabled");
digitalWrite(led, HIGH);
lcd.clear();
lcd.setCursor(5,1);
lcd.print("Ready.");
delay(250);
}
break;
}

switch (snsrstate) {
case LOW:
cutoffengine();
break;
}
}

void cutoffengine() {
if (i==0) {
Serial.println("Gear UP");
lcd.clear();
lcd.setCursor(4,0);
lcd.print("Gear Up.");
digitalWrite(cutoff, HIGH);
digitalWrite(led, LOW);
delay(kill);
digitalWrite(cutoff, LOW);
digitalWrite(led, HIGH);
delay(dly);
Serial.println("Ready.");
lcd.clear();
lcd.setCursor(5,1);
lcd.print("Ready.");
}
}

Josh_Jacob:
https://gist.github.com/KazemitoHaruhi/c1bf9a39a3472a8bbfe877458e7c1030

Compiles without errors in IDE 1.8.6 ,

8130 bytes (25%) program space & 657 bytes (32%) memory on UNO .

Arduino: 1.8.6 (Windows 10), Board: "Arduino/Genuino Uno"

sketch_sep07b:5:31: error: LiquidCrystal_I2C.h: No such file or directory

compilation terminated.

exit status 1
LiquidCrystal_I2C.h: No such file or directory

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

LiquidCrystal_I2C.h: No such file or directory

Means you don't have that library or it's not where it should be. Goto manage libraries and make sure it's installed.

is there a specific folder that the arduino program stores libraries in? i downloaded a zip folder and extracted it called liquid crystal but im not sure if it needs to be in a specific place to show up in libraries? your help is much appreciated thanks all

Libraries are searched according to a path configured somewhere in the install files. Generally however, there are two specific locations, one for the system libraries that come with the IDE distribution and will be found in the install directory. The other, for user-installed libraries, is found in a sub-directory called libraries in your sketchbook directory which is typically ..\MyDocuments\Arduino

Instructions for installing Arduino libraries:

Looks like the libraries required for that code can be found here-

   * You will need those Libraries :
   * Liquidcrystal_I2C v1.2.1 : http://tiny.cc/libLcdI2C
   * Wire                     : http://tiny.cc/libWire

as stated in the notes in the beginning of the program.

Ive changed to an Arduino nano, tried to upload the code onto it and get this error message. any ideas?

Arduino: 1.8.6 (Windows 10), Board: "Arduino Nano, ATmega328P"

Sketch uses 8192 bytes (26%) of program storage space. Maximum is 30720 bytes.
Global variables use 689 bytes (33%) of dynamic memory, leaving 1359 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x4a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x4a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x4a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x4a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x4a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x4a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x4a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x4a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x4a
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x4a
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

There is an incompatibility issue with IDEs 1.8.5 and later and the old bootloader found on older nanos. When you pull down the Tools menu and go to Board to select Arduino Nano, the next item in the Tools menu is Processor. By default this comes up as ATmega328P which you recognise as the nano processor and so ignore it and go straight to Port. You need to go back to Processor and select ATmega328P (Old Bootloader).