Beginning Arduino/Circuits - Middle School Age Appropriate

I made some changes in your code. You may or may not think they are good changes.

/*
Author: ado88
Email: arduino.ado88@gmail.com
Date: Sept 10, 2021
Revision: Version 0.2.0 Beta
License: CC0 1.0 Universal License

Project: Arduino UNO #1

Remember, "*" means to multiply, "/" means to divide

The Arduino Uno analog to digital converter compares an analog input (i.e. A0) to the 5v supply voltage.
It divides the 5V into 1024 steps called "counts" (0 to 1023).  It compares the A0 voltage to the different steps and
returns the count of the step that most closely equals the input voltage on A0
Each step is 5V/1024 = 0.00488 volts.


The PWM (Pulse Width Modulated) outputs a 490 Hz (aka 490 times a second) waveform.  The on time can be controlled in 512 steps
0 = not on time
256 = on 50% of the time
512 = on 100% of the time

In the code below, the processor will "measure" the voltage (by converting it to counts, see above)

At very low counts, the RED light will be dominant and the GREEN off.  As the voltage on the pot increases,
the RED will start to dim and the GREEN will increase in brightness.
When the pot is in the center, both LED will be on the same brightness.
etc

*/

#define RED 9 // Set red output - may need to switch LED or numbering within program
#define GREEN 10 // Set green output - #define does not use up memory resources on the Uno
#define V_POT 0 // Set voltage input pin (A0)  I know middle school will snicker at "POT"

void setup() {
    
    pinMode(RED, OUTPUT); //Set as outputs for LEDs
    pinMode(GREEN, OUTPUT);
    analogWrite(RED, 0); // Initializes red/green LED to off (LOW) (0)
    analogWrite(GREEN, 0);
    
}

void loop() {
  
  int InputVoltage = analogRead(V_POT);
  int pwmOut = 0.50 * InputVoltage; //int is a whole number variable type so it will automatically round to a whole number
      // Also resets pwmOut every time
  
    analogWrite(GREEN, (255 - pwmOut)); // From 0 to 512 its easy to convert the linear change
    analogWrite(RED, pwmOut);
    
   
  delay(100); // delay in milliSeconds. Makes the program respond more slowly to changes in POT voltage.
    
}