Skip to content

Bug in the slide switch behavior #463

Open
@nagsides

Description

@nagsides

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
image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ArduinoArduino projectAttention NeededIssues which needs to be resolved on a priority.bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions