Problem programming a shop interface, using an Arduino Starter kit.

Here is the code for my Shop interface. \

#include <LiquidCrystal.h>
LiquidCrystal lcd(12 ,11, 5, 4 , 3, 2);
const int switchPin=6;
const int SwitchPin=13;
int switchState=0;
int prevSwitchState=0;
int shopKey=0;
int reply;
void setup() {
  // put your setup code here, to run once:
lcd.begin(16,2);
pinMode(switchPin,INPUT);
pinMode(SwitchPin,INPUT);
lcd.setCursor(0,0);
lcd.print("Welcome to");
lcd.setCursor(0,1);
lcd.print("Shop!");

}

void loop() {
  // put your main code here, to run repeatedly
switchState=digitalRead(switchPin);
if (switchState==HIGH){
  shopKey=shopKey+1;
  
}
if (shopKey==1){
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Hat1$- Sword2$ ");
  lcd.setCursor(0,1);
  lcd.print("Arrow1$  Bow2$ ");
}else if(shopKey==2){
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Hat1$  Sword2$-");
  lcd.setCursor(0,1);
  lcd.print("Arrow1$  Bow2$ ");
}else if (shopKey==3){
    lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Hat1$  Sword2$ ");
  lcd.setCursor(0,1);
  lcd.print("Arrow1$- Bow2$ ");
}else if (shopKey==4){
    lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Hat1$  Sword2$ ");
  lcd.setCursor(0,1);
  lcd.print("Arrow1$  Bow2$-");
}else{
  shopKey==1;
}
  


  

}

I made my arduino setup with the starter kit. My setup is the exact same as the setup from project 11 of the arduino starter kit except that i have added a button connected to pin 13 and replaced the motion sensor with another button(connected to pin 6 like the sensor). Whenever I push the button linked to pin 6, The interface doesn't change as intended. How can I solve this issue? :confused: (note: I am almost certain this is not a hardware problem. I tested the setup but with the code provided in the starter kit and it worked fine. If you doubt my claim I have attached a photo of my setup.)

If you doubt my claim I have attached a photo of my setup.)

I'm not sure I doubt your claim (yet), but I do doubt you've posted a photo.

Calling things the same name, differing only by the case of one letter is kinda dumb.

const int switchPin=6;
const int SwitchPin=13;

Why would you do this to yourself? Can't think of two different names?

I changed the pin Numbers to switchPin1 and switchPin2. They were different before the dchange.

I can't upload my pictures of my arduino setup because there was an 413 error that prevented me from doing so.

else{
  shopKey==1;
}

Wrong.

PaulS:

else{

shopKey==1;
}



Wrong.

I did that change. The shop still didn't work unfortunately.

So what does your code look like after your corrections. Please use Ctrl-T within the IDE to format it in a manner that's easier to read.

#include <LiquidCrystal.h>
LiquidCrystal lcd(12 ,11, 5, 4 , 3, 2);
const int switchPin=6;
const int SwitchPin=13;
int switchState;
int prevSwitchState=0;
int shopKey=0;
int reply;
void setup() {
  // put your setup code here, to run once:
lcd.begin(16,2);
pinMode(switchPin,INPUT);
pinMode(SwitchPin,INPUT);
lcd.setCursor(0,0);
lcd.print("Welcome to");
lcd.setCursor(0,1);
lcd.print("Shop!");

}

void loop() {
  // put your main code here, to run repeatedly
switchState=digitalRead(6);
if (switchState==HIGH){
  shopKey=shopKey+1;
  
}
if (shopKey==1){
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Hat1$- Sword2$ ");
  lcd.setCursor(0,1);
  lcd.print("Arrow1$  Bow2$ ");
}else if(shopKey==2){
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Hat1$  Sword2$-");
  lcd.setCursor(0,1);
  lcd.print("Arrow1$  Bow2$ ");
}else if (shopKey==3){
    lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Hat1$  Sword2$ ");
  lcd.setCursor(0,1);
  lcd.print("Arrow1$- Bow2$ ");
}else if (shopKey==4){
    lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Hat1$  Sword2$ ");
  lcd.setCursor(0,1);
  lcd.print("Arrow1$  Bow2$-");
}else{
  shopKey=1;
}
  


  

}

This is how my code works like after the fix. Also I have a question. How can I upload files of a bigger size(I want to upload a picture, But the pictures file size is too big.)?

This is how my code works like after the fix.

Still looks like shit.

Please use Ctrl-T within the IDE to format it in a manner that's easier to read.

Pay attention, boy.