Hi.
My problem is, my servo doesn´t works inside an interruption, when i click on a pushbutton the servo doesns works. I tried to put on void loop and works.
My program is:
#include <Servo.h>
Servo myservo;
int pos = 0;
int counter = 0;
volatile int state = LOW;
I want to make a program that manages the inputs and outputs of the car park, showing that there is empty seats or not. On the entry and the exit there is a servo who works when a button is pressed. Its all working well but the servos not.
There is 2 interruptions (entry and exit).
Let me put it another way.
The processor checks for interrupts every instruction cycle.
An instruction executes in the time it takes a beam of light to travel 20 metres.
Why do you think an application involving a car park needs to execute on such timescales?
You don't need an interrupt here.