Display and Button Guidance

Hi there, I am in need of some guidance with a project I am making. I am not massively familiar with the arduino code and am trying to make my 8 Digit Display module start by displaying the number 0 in the far right, and when a bump sensor is pushed, I want it to increase the number on the display by 100. I have got the display currently showing the number 0 in the far right but am stuck on how to make the value increase when the bump sensor is pressed. My current code is:

const int clock = 7; //SCK
const int latch = 5; //RCK 
const int data = 6;  //DIO

int buttonpin = 3; // define the key switch sensor interface
int buttonState = 0;  

int bumppin = 42;

int redpin = 11; // select the pin for the red LED 
int greenpin = 10; // select the pin for the green LED


int val ;// define numeric variables val

byte value[] ={ B11000000, // 0
                B11111001, // 1
                B10100100, // 2
                B10110000, // 3
                B10011001, // 4
                B10010010, // 5
                B10000010, // 6
                B11111000, // 7
                B10000000, // 8
                B10010000, // 9
                B11000000, // 0
                B11111111};// display nothing

byte digit[] ={ B00000001, // left segment
                B00000010,
                B00000100,
                B00001000,
                B00010000,
                B00100000,
                B01000000,
                B10000000}; // right segment


                
void setup() {
  pinMode (redpin, OUTPUT);  
  pinMode (greenpin, OUTPUT);

  pinMode (bumppin, INPUT);

  pinMode (buttonpin, INPUT) ;// define the key switch sensoroutput interface
  
  Serial.begin(9600);
  pinMode(clock, OUTPUT);
  pinMode(latch, OUTPUT);
  pinMode(data, OUTPUT);

  digitalWrite(latch,LOW);
  shiftOut(data,clock,MSBFIRST,B11111111); // select all segments
  shiftOut(data,clock,MSBFIRST,B11111111); // display nothing
  digitalWrite(latch,HIGH); 

  digitalWrite(latch,LOW); 
  shiftOut(data,clock,MSBFIRST,digit[7]);   // select the seventh segment from left
  shiftOut(data,clock,MSBFIRST,value[0]);  // show the digit "0" ( the array starts with 0 to count!)
  digitalWrite(latch,HIGH);
}



void loop() {
  val = digitalRead (bumppin) ;// digital interface will be assigned a value of 3 to read val 
  if (val == HIGH) // When the key switch when the sensor detects a signal, LED flashes 
  { 
    digitalWrite (redpin, HIGH); 
    } 
    else 
    { digitalWrite (redpin, LOW);
    } 
}

I also have the bump sensor currently turning an LED on and off which works fine. I am almost certain that my currently display code is wrong but can't figure out how to make it do what I am after with my limited knowledge.

If anyone could give me a hand that would be much appreciated. Thanks,

The Bump Sensor I am Using: https://www.wiltronics.com.au/wp-content/uploads/datasheets/ARD2-3035%20Data%20Sheet.pdf

The Display I am Using: https://www.wiltronics.com.au/product/14503/arduino-compatible-8-digit-display-module/

but am stuck on how to make the value increase when the bump sensor is pressed.

What value?

  if (val == HIGH) // When the key switch when the sensor detects a signal, LED flashes
  {
    digitalWrite (redpin, HIGH);
    }
    else
    { digitalWrite (redpin, LOW);
    }

Your code looks like crap. Put EVERY { on a line BY ITSELF. Put EVERY } on a line BY ITSELF. Use Tools + Auto Format to at least give the impression that you care that you code looks good, even if you don't or it isn't.

I suspect that you need to take a look at the state change detection example, to see how to do something when a switch BECOMES pressed, not IS pressed.

That would be a good time to increment that value in the variable that you not declared/initialized. Each time you do that, you need to change what is displayed. Of course, that means that you need to get the individual digits from the value. The modulo operator (%) is one way.