/* AULA DIA 10/08/2022
REALIZADO POR: LARISSA
SERVO MOTOR
*/
//=============BIBLIOTECAS===========
#include <LiquidCrystal.h>
LiquidCrystal lcd (2,3,4,5,6,7);
#include <Servo.h>
Servo MOTOR;
//=========== VARIÁVEIS E TABELAS ===========
int valor_A0;
int angulo;
//================== SETUP ==================
void setup() {
// put your setup code here, to run once:
MOTOR.attach( 11 );
}
void loop() {
// put your main code here, to run repeatedly:
valor_A0 = analogRead (A0);
angulo = map ( valor_A0, 0, 1023, 0, 180 );
MOTOR.write( angulo ); // angulo de 0 a 180
}