Arduino Digital Pins output less Voltage than normal/needed

Hello, I’m trying to control two motors via two relais with an IR Remote. After trying to figure out how to use IRLib2 for two days now, I finally finished the code. Now when I run it, the remote signals get recognized, decoded and processed correctly, but the LEDs indicating that the right pin turned HIGH, glow way darker than they should and the transistors connected to these LEDs in series don’t activate. When I run another sketch that just regularly turns the pins HIGH and LOW, everything works fine (I even included the Library and enabled the IR inputs to see, if that manipulates the voltage somehow; everything connected to the Arduino is the same). I don’t have a multimeter here right now, but judging by connecting an LED to 5V/GND the Arduino is in both cases able to output 5v, just not at its digital Pins.
Because the circuit works as it should with the test program, I guess something in the code should be wrong, but I don’t have any clue whatsoever what to look for… Could anybody help me?
I am using this board: https://www.amazon.de/gp/product/B07B5ZPJ4G/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1
and some transistors and relays I stole from broken RC cars, but they all work fine…

Thanks in advance (can you word it like that? My English is really not the best… sry)

P.S ah and yes, my knowledge of C/C++ is very limited aswell, I tried processing the codes out in arrays but really couldn’t get behind of how to use arrays/lists in functions, so I stuck to that custom method; the IR codes are ones I read out and found out, that I only need a small part of the code to recognize it…

[code]
#include <IRLibRecvPCI.h>
int l_forward = 12;
int l_backward = 11;
int r_backward = 10;
int r_forward = 9;
IRrecvPCI myReceiver(2);
void forward(){digitalWrite(r_forward, HIGH); digitalWrite(l_forward, HIGH); digitalWrite(r_backward, LOW); digitalWrite(l_backward, LOW); Serial.print("forward");}
void backward(){digitalWrite(r_backward, HIGH); digitalWrite(l_backward, HIGH); digitalWrite(r_forward, LOW); digitalWrite(l_forward, LOW); Serial.print("backward");}
void turn_left(){digitalWrite(r_forward, HIGH); digitalWrite(l_backward, HIGH); digitalWrite (r_backward, LOW); digitalWrite(l_forward, LOW); Serial.print("right");}
void turn_right(){digitalWrite(r_backward, HIGH); digitalWrite(l_forward, HIGH); digitalWrite (r_forward, LOW); digitalWrite(l_backward, LOW); Serial.print("left");}
void stand_still(){digitalWrite(r_forward, LOW); digitalWrite(l_forward, LOW); digitalWrite(r_backward, LOW); digitalWrite(l_backward, LOW); Serial.print("stop");}
void inp_to_code(){
  int outp[] {0,0,0,0,0};
  for (int i=0; i < 5; i++){
    int temp = recvGlobal.recvBuffer[i+36];
    if (temp < 650) {outp[i] = 0;}
    else (outp[i] = 1);}
  if (outp[0] == 0) {
    if (outp[2] == 1) {}
    else if (outp[4] == 0) {turn_left();}
    else if (outp[4] == 1) {stand_still();}
  }
  else if (outp[0] == 1) {
   if (outp[2] == 0) {backward();}
   else if (outp[4] == 0) {forward();}
   else if (outp[4] == 1) {turn_right();}
  }
  }
void setup() {
  Serial.begin(9600);
  for (int i; i < 5; i++){
    pinMode(12-i, OUTPUT);
  }
  myReceiver.enableIRIn();
}

void loop() {
  if (myReceiver.getResults()) {
    inp_to_code();
    delay(200);
    Serial.println("");
    myReceiver.enableIRIn();
  }
}

[/code]

There are no prizes for writing your description or code with no line breaks.

but the LEDs indicating that the right pin turned HIGH, glow way darker than they should

LEDs?

My English is really not the best

The forum has a German section

TheMemberFormerlyKnownAsAWOL: There are no prizes for writing your description or code with no line breaks.

Umm... I just wanted to get those lines out of the way... I hate it when I have to scroll down so far, and the long code lines really just are an enumeration of the same thing over and over again... And if the website automatically puts line breaks into my text then why not use it..? : )

TheMemberFormerlyKnownAsAWOL: LEDs?

Is there anything wrong with my usage of the word "LED"? I just put those light-emitting diodes between the digital Pins and the rest of my circuit to be able to visually tell witch pin is set to HIGH...

TheMemberFormerlyKnownAsAWOL: The forum has a German section

Yes I read that in the "How to properly write a forum post" Note, but I thought that the english community is generally larger and I would get a faster awnser, so that I can continue playing around with the code and arduino... And I think I should be able to understand everything, I have yet to find a english communtity post that I'd have to translate via Google... Thanks for the quick response, I really don't see how that could help me though...

I highlighted LEDs, because there’s no mention of them in the code.

And if the website automatically puts line breaks into my text

It does?

Anyway, if you want to make things hard to help you, who am I to stop you?

Good luck.

timmi315: Umm... I just wanted to get those lines out of the way... I hate it when I have to scroll down so far, and the long code lines really just are an enumeration of the same thing over and over again... And if the website automatically puts line breaks into my text then why not use it..? : )

Is there anything wrong with my usage of the word "LED"? I just put those light-emitting diodes between the digital Pins and the rest of my circuit to be able to visually tell witch pin is set to HIGH... Yes I read that in the "How to properly write a forum post" Note, but I thought that the english community is generally larger and I would get a faster awnser, so that I can continue playing around with the code and arduino... And I think I should be able to understand everything, I have yet to find a english communtity post that I'd have to translate via Google... Thanks for the quick response, I really don't see how that could help me though...

Can you post a wiring diagram?

I recjon the pinMode is not set, so only seeing internal pullups:

void setup() {
  Serial.begin(9600);
  for (int i; i < 5; i++){   ////// i is not initialized, local variables contain junk if not initialized.
    pinMode(12-i, OUTPUT);
  }
  myReceiver.enableIRIn();
}

Use

  for (int i = 0 ; i < 5 ; i++)

Did you turn on compiler warnings and read them? Always worth doing…

TheMemberFormerlyKnownAsAWOL: I highlighted LEDs, because there's not mention of them in the code. It does?

Anyway, if you want to make things hard to help you, who am I to stop you?

I'm sorry, I didn't want to appear rude, I really did not understand, what you wanted.... the LEDs are connected to the 4 defined OUTPUT pins, they are wired in series to the relais labeled r_forward, r_backward, l_forward and l_backward... Sorry if I offended you, I genuenly didn't want to, I was just happy to maybe see a solution and then had to read a post of someone kind of complaining about the code and my English... sorry

MarkT:
I recjon the pinMode is not set, so only seeing internal pullups:

void setup() {

Serial.begin(9600);
 for (int i; i < 5; i++){   ////// i is not initialized, local variables contain junk if not initialized.
   pinMode(12-i, OUTPUT);
 }
 myReceiver.enableIRIn();
}




Use 


for (int i = 0 ; i < 5 ; i++)




Did you turn on compiler warnings and read them? Always worth doing....

Okay thats weird, I have for (int i = 0 ; i < 5 ; i++) written in my actual code, maybe the “copy for forum” feature in the IDE messed that up… Yes, I have them turned on, but after trying to fix the errors over the day all of the warnings are gone…
okay wow, thats a lot of awnsers in a very short time… Sorry, I’ll have to wait five minutes for every post… (makes sense to me though…)

abdelhmimas:
Can you post a wiring diagram?

wiring diagram
I’m just gonna hope it works like that… (I used the Arduino UNO model, because they had no other one; I am using a knockoff board with an ATMega2560 Chip, but it should have the same properties as an original one)
Took me longer than it schould have, but there you go. I hope it’s not too confusing, I have not really done something like this before…
Hope it helps, thanks for awnsering! : )

timmi315:
Okay thats weird, I have for (int i = 0 ; i < 5 ; i++) written in my actual code, maybe the “copy for forum” feature in the IDE messed that up… Yes, I have them turned on, but after trying to fix the errors over the day all of the warnings are gone…
okay wow, thats a lot of awnsers in a very short time… Sorry, I’ll have to wait five minutes for every post… (makes sense to me though…)

Omg wow that was dumb, I was correcting the wrong code, it worked now! Thank you so much!
Do I need to delete anything on here now? I mean this seems like a fairly insignificant problem that does not really need to stay online for documentation…
it was actually the pinMode that was set up wrong, you were right, Thank you!

No, leave it as it is.

TheMemberFormerlyKnownAsAWOL: No, leave it as it is.

Okay... again, thank you, and sorry if you felt attacked or offended, I didnt mean to...