Using an IR Break Sensor to change a score on a LED Matrix

I am relatively new to coding and need some help with coding an IR Break sensor using Javascript to change a score tally on an LED Matrix from 1 to 2 to 3 and so on. When an object has broken the Infra-red beam. I'm trying to make a sort of scoring bin. Can anyone help?

This is an Arduino forum... will you be using an Arduino somewhere in your project? Which one will you be using?

Do you have details of the IR sensor and LED matrix?

Yes, I will be using a UNO R3 for this project

Yes i am using an arduino

You are going to have to give us more details about the hardware you are using (as per the request in post #2). What you want to do is possible but how you do it depends on what you have.

I am using the following components to create my project.

Adafruit IR Break sensors 5mm
Spark Fun COM-08546 7-segment RED LED
Arduino uno 3

I need the code to be in Java.
Can anyone help with the code to communicate between the Sensor to the 7 segment LED to take score every time the beam is broken.

let me know if need more information to help me

as others have mentioned, this is an Arduino forum and the Arduino uses c++.

I'm using Arduino software which uses java as the language and an Arduino uno 3

can you post a link to the software package you installed that supports java on arduino?

Software | Arduino

that's what i use. while the IDE may be written in Java, the code for the Arduino needs to be written in C++

Dose it makes a difference if I am running the Arduino from the PC. Because I have some java script written by Adafruit that want to adapt to my project as I am not fluent in java and i am still learning. I understand that Arduino uses C++, but i'd like to use java.

Arduino | IR Breakbeam Sensors | Adafruit Learning System

I found this code for my project and want to know how to code the 7 segment LED into the code to make it so when an object passes the sensor the LED goes up in value. Is this possible?

You guys have been really helpful but could you advise me on this as im not sure now if this is C++ or Java

c++

what is the circuit for your display?
the Multi-function shield has a 7-segment display. you could use the code from that

This is the hardware I have for my project I just need the 7 segments led to change number when the IR beam has been broken.

can anyone help?

https://create.arduino.cc/projecthub/arduino_uno_cool/create-a-7-segment-display-254ebe

I have the 7-segment display working. Apologise I should have said in my previous post I need the screen to charge on the input of the IR Break sensor.

I have the code from adafruit for both the screen and ir break sensor I just need a hand combining the two codes.

if you need both code let me know

So at the moment, the 7-segment display counts to 9 on loop. I just need the 7 segments to count when someone puts their hand in front of the IR Brake Sensors.

Let me know if you need the link to the code.

yes, please post the code (think about it)

Code for the 7 segment display, This just allows the display to count on loop from 1 to 9

int pinA = 2;
int pinB = 3;
int pinC = 4;
int pinD = 5;
int pinE = 6;
int pinF = 7;
int pinG = 8;



// the setup routine runs once when you press reset:
void setup() {  
  pinMode(pinA, OUTPUT);     
  pinMode(pinB, OUTPUT);     
  pinMode(pinC, OUTPUT);     
  pinMode(pinD, OUTPUT);     
  pinMode(pinE, OUTPUT);     
  pinMode(pinF, OUTPUT);     
  pinMode(pinG, OUTPUT);   
}

// the loop routine runs over and over again forever:
void loop() {
  //0
  digitalWrite(pinA, LOW);   
  digitalWrite(pinB, LOW);   
  digitalWrite(pinC, LOW);   
  digitalWrite(pinD, LOW);   
  digitalWrite(pinE, HIGH);   
  digitalWrite(pinF, LOW);   
  digitalWrite(pinG, LOW);
  delay(1000);  
   //1
  digitalWrite(pinA, HIGH);   
  digitalWrite(pinB, HIGH);   
  digitalWrite(pinC, HIGH);   
  digitalWrite(pinD, LOW);   
  digitalWrite(pinE, HIGH);   
  digitalWrite(pinF, LOW);   
  digitalWrite(pinG, HIGH);  
    delay(1000);  
       //2
  digitalWrite(pinA, LOW);   
  digitalWrite(pinB, HIGH);   
  digitalWrite(pinC, LOW);   
  digitalWrite(pinD, LOW);   
  digitalWrite(pinE, LOW);   
  digitalWrite(pinF, HIGH);   
  digitalWrite(pinG, LOW);  
    delay(1000);  
          //3
  digitalWrite(pinA, HIGH);   
  digitalWrite(pinB, HIGH);   
  digitalWrite(pinC, LOW);   
  digitalWrite(pinD, LOW);   
  digitalWrite(pinE, LOW);   
  digitalWrite(pinF, LOW);   
  digitalWrite(pinG, LOW);  
    delay(1000); 
            //4
  digitalWrite(pinA, HIGH);   
  digitalWrite(pinB, LOW);   
  digitalWrite(pinC, HIGH);   
  digitalWrite(pinD, LOW);   
  digitalWrite(pinE, LOW);   
  digitalWrite(pinF, LOW);   
  digitalWrite(pinG, HIGH);  
    delay(1000);    
     //5
  digitalWrite(pinA, HIGH);   
  digitalWrite(pinB, LOW);   
  digitalWrite(pinC, LOW);   
  digitalWrite(pinD, HIGH);   
  digitalWrite(pinE, LOW);   
  digitalWrite(pinF, LOW);   
  digitalWrite(pinG, LOW);
  delay(1000);  
   //6
  digitalWrite(pinA, LOW);   
  digitalWrite(pinB, LOW);   
  digitalWrite(pinC, LOW);   
  digitalWrite(pinD, HIGH);   
  digitalWrite(pinE, LOW);   
  digitalWrite(pinF, LOW);   
  digitalWrite(pinG, LOW);  
    delay(1000);  
       //7
  digitalWrite(pinA, HIGH);   
  digitalWrite(pinB, HIGH);   
  digitalWrite(pinC, LOW);   
  digitalWrite(pinD, LOW);   
  digitalWrite(pinE, HIGH);   
  digitalWrite(pinF, LOW);   
  digitalWrite(pinG, HIGH);  
    delay(1000);  
          //8
  digitalWrite(pinA, LOW);   
  digitalWrite(pinB, LOW);   
  digitalWrite(pinC, LOW);   
  digitalWrite(pinD, LOW);   
  digitalWrite(pinE, LOW);   
  digitalWrite(pinF, LOW);   
  digitalWrite(pinG, LOW);  
    delay(1000); 
            //9
  digitalWrite(pinA, HIGH);   
  digitalWrite(pinB, LOW);   
  digitalWrite(pinC, LOW);   
  digitalWrite(pinD, LOW);   
  digitalWrite(pinE, LOW);   
  digitalWrite(pinF, LOW);   
  digitalWrite(pinG, HIGH);  
    delay(1000);    
}