I am trying to create a lock for my door with a servo but to create the file and compile it gives me the error of compilation in the arduino/Genuino UNO
Here is the code:
#include <Servo.h>
Servo miServo;
const int pinPot = 0;
const int pinServo = 2;
const int pulsoMin = 650; // pulso min para girar el servo a 0º
const int pulsoMax = 2550; // pulso en us para girar el sevo a 180º
Rfapr:
void loop ()
;valor = analogRead(pinPot); // leemos el valor del potencimetro
Should be:
void loop () {
valor = analogRead(pinPot); // leemos el valor del potencimetro
Rfapr:
I don't know what i can do
Take some time to understand how the simple example sketches work before trying something more advanced. If you understood what every line of File > Examples > 01.Basics > BareMinimum did then it would have been obvious to you what the problem was.
After doing Tools > Auto Format look at the indentation of the code. Clearly void loop () should not have been indented. This is a clue that something is wrong with the code above that line.
Please use code tags(</> button on the toolbar) whenever you post code or error/warning messages on the forum. Always post the full error message, saying "it gives an error" is not very helpful. When there is an error you will see a button "Copy error messages" on the right side of the orange bar. Click that button and then paste the full error message.