Digital Read Help

My problem-
I need a circuit that will activate a red LED when 3 or less switches are activated and a green LED when more than 3 switches are activated. A total of 4 switches.

My is program is not complete by all means, I would like some help with the rest. Thanks in advance!

Update, it WORKS!-
Thanks for all your help, final code is listed below.

const int buttonPin1 = 1;     // the number of the pushbutton p
const int buttonPin2 = 2;     // the number of the pushbutton pin
const int buttonPin3 = 3;     // the number of the pushbutton pin
const int buttonPin4 = 4;     // the number of the pushbutton pin
const int ledPinLOW =  12;      // the LOW fan
const int ledPinHIGH =  13;      // the HIGH fan
int val = 0;

void setup() {
  // put your setup code here, to run once:
pinMode(13, OUTPUT);  //The HIGH Fan
pinMode(12, OUTPUT);  //The LOW Fan
pinMode(4, INPUT);  //Switch 4
pinMode(3, INPUT);  //Switch 3
pinMode(2, INPUT);  //Switch 2
pinMode(1, INPUT);  //Switch 1

}

void loop() {

val = digitalRead(1) + digitalRead(2) + digitalRead(3) + digitalRead(4);   // read the input pin
  
/////////////////////////////////////////////////////////////////////////////

if(val == 0)
{
 digitalWrite(12, LOW);  //LOW speed fan turns off
 digitalWrite(13, LOW);  //HIGH speed fan turns off 

}  //End hotCount

/////////////////////////////////////////////////////////////////////////////  

if(val == 1)
{
 digitalWrite(12, HIGH);  //LOW speed fan comes on
 digitalWrite(13, LOW);  //HIGH speed fan turns off 

}  //End hotCount

///////////////////////////////////////////////////////////////////////////// 
if(val == 2)
{
 digitalWrite(12, HIGH);  //LOW speed fan comes on
 digitalWrite(13, LOW);  //HIGH speed fan turns off 

}  //End hotCount

///////////////////////////////////////////////////////////////////////////// 

if(val == 3)
{
 digitalWrite(12, HIGH);  //LOW speed fan comes on
 digitalWrite(13, HIGH);  //HIGH speed fan comes on
 
}  //End hotCount

///////////////////////////////////////////////////////////////////////////// 

if(val == 4)
{
 digitalWrite(13, HIGH);  //HIGH speed fan comes on
 digitalWrite(12, LOW);  //LOW speed fan turns off

}  //End hotCount 

}  //End Loop

Please post your program here (using code tags).
It is so much more convenient than having to download it.

Honestly, dont know how to do that.

Copy/paste in your code into forum, select it, then click the code button (the one that looks like </> )

A suggestion.
Put the input pin numbers in an array. Set a count variable to zero. Read the input pins using a for loop and add one to the count variable for every input that is on. At the end of the for loop act on the value of the count variable.

If you can`t tell I am new to this, can you give me an example.

val = digitalRead(1), digitalRead(2), digitalRead(3), digitalRead(4);

is the same as this

val=digitalRead(4); (see: "Comma Opperator")

It looks like you're trying to combine them somehow, but it's not clear exactly how.

I'd think this would be more like what you want:

val=digitalRead(1) + digitalRead(2)*2+digitalRead(3)*4+digitalRead(4)*8;

Don't use pins 0 or 1 for your sketch unless you're using them for serial, or you really need that pin - those are used for serial, so pressing the buttons would interfere with serial communication (which you will likely want to use for debugging).

You code will be smaller (in terms of flash and ram use) if you replace the const ints with #defines (these are replaced, like text find/replace, by the preprocessor - note how the syntax is different):
#define buttonPin1 1 // Note: No =, and no ;

Convention is to make #defines all caps, so you can tell them apart from normal variables that might change:

#define BUTTON_PIN_1 1

Just to make sure - you want to monitor 4 inputs and light an LED if any 3 of them are active?

nolanwa:
If you can`t tell I am new to this, can you give me an example.

const byte pins[] = {2, 3, 4, 5};  //your pin numbers go in this array
byte count = 0;

void setup()
{
  Serial.begin(115200);
  for (int pin = 0; pin < 4; pin++)
  {
    pinMode(pins[pin], INPUT_PULLUP);
  }
}

void loop()
{
  count = 0;
  for (int pin = 0; pin < 4; pin++)
  {
    if (digitalRead(pins[pin]) == LOW)
    {
      count++;
    }
  }
  //do stuff with the value of count
}