Bug in the slide switch behavior #463
Labels
Arduino
Arduino project
Attention Needed
Issues which needs to be resolved on a priority.
bug
Something isn't working
good first issue
Good for newcomers
This experiment is taken from https://www.javatpoint.com/arduino-switch#:~:text=The%20slide%2Dswitch%20in%20Arduino,used%20in%20small%20circuits%20applications.

The image shown below was drawn on the workspace
This was the ino file used for the above circuit:
const int pinOFswitch = 3;
const int LED = 8;
void setup( ) {
pinMode(pinOFswitch, INPUT);
pinMode(LED, OUTPUT);
}
void loop( )
{
int ValueOFswitch;
ValueOFswitch = digitalRead(pinOFswitch);
if (ValueOFswitch == HIGH)
{
digitalWrite(LED, HIGH);
delay(500);
}
else
{
digitalWrite(LED, LOW);
delay(500);
}
}
The problem is with the slide switch not working in this configuration
The text was updated successfully, but these errors were encountered: