First off I want to apologize for asking this since it seems so simple I hate to waste anyones time but I can't seem to get my Elegoo to recognize a second int entry/setting. How do I get the Elegoo to save my second int entry?
I am working on a project for a friend. This project alternates between energizing solenoid number one for one second then releases it, then energizes solenoid number two then releases it, then repeats the process and loops back to energize solenoid one then two etc. Constantly energizing one then the other solenoid. Currently the setup only energizes the first int entry. To troubleshoot I moved the wire from pin 12 on the Elegoo to pin 9 on the L298N which energized that solenoid which bring me back to pin 13 on the Elegoo not being activated.
The parts I am using are:
Elegoo UNO R3
L298N
(2)Uxcell a14092600ux0438 Open Frame Actuator Linear Mini Push Pull Solenoid Electromagnet, DC 4.5V, 40 g/2 mm
The Elegoo gets its power from the 5V connection on the L298N
The L298N gets its power from a 9V dc battery
The Elegoo is connected to the L298N using pins 12 and 13 on the Digital PWM connector leading to the L298N pins 8 and 9 respectively
Jumpers are on pin 7 and 12 on the L298N
Solenoids hot wires on connections 1 and 2 of L298N
Solenoids grounded to connection 5 (dc input ground) on L298N
Here is my sketch:
//Project: To control 2 solenoids with Elegoo UNO R3 and L298N
//doesn't save the second int entry
int solenoidPin = 12; //This is the output for 1st solenoid
int solenoidPin2 = 13; //This is the output for 2nd solenoid
void setup()
{
pinMode(solenoidPin, OUTPUT); //Sets that pin as an output
pinMode(solenoidPin2, OUTPUT); //Sets that pin as an output
}
void loop()
{
digitalWrite(solenoidPin, HIGH); //Switches 1st Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin, LOW); //Switches 1st Solenoid OFF
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin2, HIGH); //Switches 2nd Solenoid ON
delay(1000); //Wait 1 Second
digitalWrite(solenoidPin2, LOW); //Switches 2nd Solenoid OFF
delay(1000); //Wait 1 Second
}
I am attaching pics of my setup. Again, I apologize for asking such a simple question, or maybe it is complicated and I am making it too simple.

