attempting to make outputs inverted

trying to replicate simple things i am familiar with such as an inverted output using CMOS chips.
i butchered some examples for turning outputs on from inputs (wild times) and now i am trying to get one output to go high, and the other to do the opposite, both controlled by a single input.

so imagine a switch and 2 leds, one led is on, when switch state is changed, led that is on turns off, led that is off turns on.

i pulled the IF and ELSE parts from the IF ELSE STATEMENT example and changed it as best as i could guess.

I am about to go to bed so wont be able to reply for about 12 hrs, sorry.

when i run this code, only the output ledPin will turn on when switch is closed.
if i change ledPin to ledPin2 then ledPin2 will turn on and off with the switch, but ledPin will not.
so the ELSE IF is just totally ignored.

int ledPin = 13;   //output to led
int ledPin2 =12;  //output to other led
int inPin = 7;    //input from switch
int val = 0;      //state of the input

void setup() {
  // put your setup code here, to run once:
pinMode(ledPin, OUTPUT);  //defines the I/O state of pin
pinMode ( inPin, INPUT);   // defines the I/O state of pin
pinMode (ledPin2, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  
if (ledPin, HIGH) {
    digitalWrite(ledPin2, LOW);
  } else {
    digitalWrite(ledPin2, HIGH);
  }

  val = digitalRead(inPin); //read the state of the input pin
  
  digitalWrite (ledPin, val);
  

}

if (ledPin, HIGH) {You are missing a digitalRead and a comparison

I am about to go to bed so wont be able to reply for about 12 hrs, sorry.

When you do, maybe you can get your post squared away. You CODE goes in code tags, NOT your whole damned post.

When you hit the code icon, it puts [code][/code] Your code goes BETWEEN the ] and the [, NOT before the ].

PaulS: When you do, maybe you can get your post squared away. You CODE goes in code tags, NOT your whole damned post.

When you hit the code icon, it puts [code][/code] Your code goes BETWEEN the ] and the [, NOT before the ].

Dear Mr Mcwhorter I had assumed the code went in between the code brackets, but due to being really really tired after a 12 hr shift, i probably missed the gap or something. It's good to see that you are still kicking around this forum years since I have been on here, but it looks like a search for your people skills returns an error 404.

f111: but it looks like a search for your people skills returns an error 404.

Wrong forum. This one is for coding help. If you want people skills and help with your feelings then try this one. They're guaranteed to talk nicely to you and make you feel all warm and fuzzy, but be aware that they don't know jack about coding so they won't be able to help you any with your project.