Arduino Plinko

I'm trying to make a Plinko board using the Arduino, and I'm just trying to get a score to display after a micro limit switch is activated. I've tested the limit switches using a basic button program included in the "examples" tab of the Arduino, and they work with the five volts. Here's my code. I'm really stumped, so any help would be much appreciated.

#include <LiquidCrystal.h>

#define RS_Pin 7
#define ENABLE_Pin 8
#define D4_Pin 9
#define D5_Pin 10
#define D6_Pin 11
#define D7_Pin 12

LiquidCrystal LCD =
{RS_Pin, ENABLE_Pin, D4_Pin, D5_Pin, D6_Pin, D7_Pin};

byte PointNum;
byte Points;

bool WhateverPin1;
bool WhateverPin2;
bool WhateverPin3;
bool WhateverPin4;
bool WhateverPin5;

void setup()
{
pinMode(1, INPUT);
pinMode(3, INPUT);
pinMode(4, INPUT);
pinMode(5, INPUT);
pinMode(6, INPUT);

};

void loop()
{
WhateverPin1 = digitalRead(2);
WhateverPin2 = digitalRead(3);
WhateverPin3 = digitalRead(4);
WhateverPin4 = digitalRead(5);
WhateverPin5 = digitalRead(6);

if (WhateverPin1 == HIGH)
{
PointNum = 1;

PegBoard();
};
if (WhateverPin2 == HIGH)
{
PointNum = 2;

PegBoard();
};
if (WhateverPin3 == HIGH)
{
PointNum = 3;

PegBoard();
};
if (WhateverPin4 == HIGH)
{
PointNum = 4;

PegBoard();
};
if (WhateverPin5 == HIGH)
{
PointNum = 5;

PegBoard();
};

};

void PegBoard()
{
switch (PointNum)
{
case 1:
Points = 10;

break;
case 2:
Points = 15;

break;
case 3:
Points = 50;

break;
case 4:
Points = 30;

break;
case 5:
Points =100;

break;
};

LCD.setCursor(1, 0);
LCD.println("Your score is: ");
LCD.setCursor(14, 1);
LCD.println(Points);
delay(1000);
LCD.clear();
};

void setup()
{
  pinMode(1, INPUT);
  pinMode(3, INPUT);
  pinMode(4, INPUT);
  pinMode(5, INPUT);
  pinMode(6, INPUT);

};

void loop()
{
  WhateverPin1 = digitalRead(2);
  WhateverPin2 = digitalRead(3);
  WhateverPin3 = digitalRead(4);
  WhateverPin4 = digitalRead(5);
  WhateverPin5 = digitalRead(6);

Let's play "spot the difference"

That was just an oversight. I've changed those before so they match, but it still doesn't change anything.

You still haven't told us what the problem is.

TolpuddleSartre:
You still haven't told us what the problem is.

Every time I try to put an input using the limit switch, the display is still blank. It's not displaying the points, and frankly, I don't even know if the inputs are registering.

and frankly, I don't even know if the inputs are registering.

Why not? That's what Serial.begin() and Serial.print() are for.

PaulS:
Why not? That's what Serial.begin() and Serial.print() are for.

I'm new to coding, so I have no idea what that is.

Take a look at the examples that come with the IDE. Basics->DigitalReadSerial would be a good place to start.

wildbill:
Take a look at the examples that come with the IDE. Basics->DigitalReadSerial would be a good place to start.

I will, but the point still stands. Nothing is sending to the display after a limit switch is pressed. I don't even know where to start with that one.

The place to start is to see what values you are inputting.

Serial.begin, Serial.println

TolpuddleSartre:
The place to start is to see what values you are inputting.

Serial.begin, Serial.println

I know the limit switch works. I've tested it using the "button" sketch. I know those aren't the issue. It's a coding issue.

It's a coding issue

So, what steps are you going to take to work out what your problem is?

Remember, you're the one with the hardware in front of you, not us.

I have no idea. If I had an idea, I wouldn't be here. I don't understand coding very well, so I'm asking you guys for help with said code.

What people are trying to suggest is that there are multiple parts to your project and multiple possible failure modes. The common way to make progress is to eliminate some of them. Perhaps the LCD contrast setting (if you have one) is such that your program is working as expected but the results don't show up. Perhaps you have a wiring issue with the LCD, perhaps it's broken.

So one way to make the problem simpler is to use Serial.println to show your outputs instead of the LCD. Serial.print your inputs too and keep adding debug prints until you find out what's going on. That's what the folks here would do in your place but, as observed above, we don't have the hardware to run those tests.

Alternatively, keep your wiring & just print to the LCD & prove it's ok. It's just divide & conquer.

wildbill:
Alternatively, keep your wiring & just print to the LCD & prove it's ok. It's just divide & conquer.

I've just done that, and everything runs smoothly with a basic "hello world." From there, I got nothing.

Good stuff, that eliminates a bunch of possibilities. It suggests to me that the pegboard function is never called. Which in turn suggests that your limit switches aren't being read. I know you believe they are, but serial will prove it one way or the other.