Page 65 - Proyecto integrador final - Génesis Orozco Chauca
P. 65

CÓDIGO:
                                                                              #include <Servo.h>
                    DISEÑO                                                    Servo e;
                                                                              #include <LiquidCrystal.h>
                                                                              LiquidCrystal a(1,2,3,4,5,6);
                                                                              int la=0;
                                                                              void setup()
                                                                              {
                                                                                a.begin(16,2);
                                                                                pinMode(8,OUTPUT);
                                                                                pinMode(9,OUTPUT);
                                                                                pinMode(10,OUTPUT);
                                                                                e.attach(7);
                                                                              }
                                                                              void loop() {
                                                                                la=analogRead(A0);
                                                                                la=map(la,0,1023,1,180);
                                                                                e.write(la);
                                                                                delay(100);
                                                                                a.setCursor(3,0);
                                                                                a.print("Servo motor");
                                                                                a.setCursor(4,1);
                                                                                a.print("Grados= ");
                                                                                a.setCursor(11,1);
                                                                                a.print(la);
                                                                                delay(500);
                                                                                a.clear();
                                                                              }








































                                                           65
   60   61   62   63   64   65   66   67   68   69   70