Help with a code that doesnt work

Hello guys, I am a student and for the course MICROCONTROLLERS we have to make a project with arduino, my code doesnt work correctly.

i want to display the temperature in Celsius on 2 7 segment displays, and a IR remote that can turn a led red or green.

this is the link to my current tinkercad design and code.
Please can someone help me with this asap, its my last chance to get a good result.

regards

Welcome to the forum

Please post your sketch and schematic here to avoid the need for a Tinkercad account

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

Few helpers here will follow external links. Please post the code and design here in messages. Note that you didn't say at any point, what is actually wrong...

So the problem is that my temperature doesnt show up on the 7 segment displays, and i get an error if i want to control the RGB led with the IR remote. Im verry new to all of this so for me this is verry hard

#include <IRremote.h>
int temp;
int tempPin = A2;
int L,R;
int RECV_PIN = 6;
int ROOD = 11;
int GROEN = 9;
int DS_pin = 4;
int STCP_pin =3;
int SHCP_pin = 2 ;

int dec_digits [10] {1,79,18,6,76,36,32,15,0,4}; //  decimaal 0>9

void BCD0(int);
void BCD1(int);

IRrecv irrecv(RECV_PIN); // bibliotheek IR 
decode_results results;

void setup()
{
  pinMode(DS_pin, OUTPUT);
  pinMode(STCP_pin, OUTPUT);
  pinMode(SHCP_pin, OUTPUT);
  pinMode(A2, INPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  Serial.begin(9600);
  
  // seriele aanzet IR 
  Serial.begin(9600);
  Serial.println("Enabling IRin");
  irrecv.enableIRIn(); 
  Serial.println("Enabled IRin");
}




void loop()
{
  if (irrecv.decode(&results)) {//irrecv.decode(&results) geeft een true als het iets ontvangt en slaat dat op in een resultaat
    unsigned int value = results.value; 
    switch (value) {
      case 2295: 
      	digitalWrite(ROOD, HIGH);
      	delay(500);
      	digitalWrite(ROOD, LOW);
      	break;
      
      case 34935:
      	digitalWrite(GROEN, HIGH);
      	delay(500);
      	digitalWrite(GROEN, LOW);
      	break;
   }
    
    irrecv.resume(); // volgende waarde ontvangen 
 
  
temp = analogRead(tempPin);
temp = temp * 0.48828125;
L = (temp/10);
R = (temp -((temp / 10) * 10));
delay(100)
;BCD0(L);
;BCD1(R);
  

void BCD0(int number) 
{
  int pin= 2;
  for (int j=0; j < 7; j++) {
   digitalWrite(STCP_pin,LOW);
    shiftOut(DS_pin, SHCP_pin, LSBFIRST,dec_digits[j]);
    digitalWrite(STCP_pin, HIGH);
   pin++;
     Serial.println(L);
  }
}
  }

void BCD1(int number) 
{
  int pin= 3;
  for (int j=0; j < 7; j++) {
   digitalWrite(STCP_pin,LOW);
    shiftOut(DS_pin, SHCP_pin, LSBFIRST,dec_digits[j]);
    digitalWrite(STCP_pin, HIGH);
   pin++;
     Serial.println(R);
  }
 }

 

That we can't see. Please cut the complete error listing from the compile window and paste it here.

So the problem is that my temperature doesnt show up on the 7 segment displays

What does show up?

Please anticipate obvious questions and answer them before they have to be asked. It will speed up the help process enormously.

The Fritzing diagram is useless for troubleshooting help here. It's also too fuzzy to read. Please provide an actual wiring diagram (schematic).

You pass a variable called 'number' which you then don't use.

When the display is turned on it gives me the same numbers (like 77, 66,44) so it does not work separetly

See reply #6

Also you have mis-matched braces {}. It is causing your compile errors.

Ah, i see.
wich variable do i have to use then ? i declared int L and R in the beginning should i write this instead of number then ?

The Fritzing schematics you posted are useless. They are machine generated layouts that are actually worse than the layout view. Please draw a real schematic and post it.

How much time do you have to complete this project? I ask because I can see that you're trying to program way, way above your actual level of C knowledge. What you are asking is really basic stuff. Not just for me, but for any beginner programmer.

I don't know how to draw a schematic im sorry.

This project should be finished by the end of this week. I have little to No knowledge about programming in C that's why i am out of idea's to get this to work. The project assignment was given to me i could not choose the level of difficulty..

How did that happen? Usually, courses like that have entrance requirements or prerequisites. Also assignments like this don't pop up out of thin air. There are always lectures, exercises, labs, etc. Did you skip some?

Please do not post pictures of code and errors

Remember to use code tags (the </> icon above the compose window) to make it easier to read and copy for examination