Please view the attached files to see if problem is in the code or the circuit. It's supposed to be a normal switch type circuit, just passing through arduino.
The arduino files and circuit diagram on proteus are attached.
I tried using arduino simulation on Proteus but not working.
The arduino files and circuit diagram on proteus are attached.
Code (C):
- int switchPin = 8;
- int ledPin = 9;
- int ctr = 0;
- void setup() {
- // put your setup code here, to run once:
- pinMode(switchPin,INPUT);
- pinMode(ledPin,OUTPUT);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- if(digitalRead(switchPin)==LOW)...