/* this is the copy of my first project , which was made when i didnt have
a wokwi account so its not saved it my library
*/
int number = 25;// input number
int pin; // 2 or 5
int evenPin = 2 ; // green led
int oddPin = 5 ; // red led
void setup() {
pinMode(pin, OUTPUT);
}
void loop() {
int result = number % 2 ; // using the modulos operator
if(result == 0){
pin = evenPin; // number is even , light up the green led
}
else {
pin = oddPin; // number is odd , light up the red led
};
//for blinking the code
digitalWrite(pin, HIGH);
delay(1000);
digitalWrite(pin, LOW);
delay(1000);
}
//this dogshit code was written by Roger and Swela form no prior knowledge
//of arduino just pure w