From cbd2bcfccb68de66a151435815445f2dcc23e7d6 Mon Sep 17 00:00:00 2001 From: Miguel Delgado Date: Tue, 2 Nov 2021 09:45:23 -0600 Subject: [PATCH] Create SeguidorLineaArduino.ino Codigo Inicial --- SeguidorLineaArduino/SeguidorLineaArduino.ino | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 SeguidorLineaArduino/SeguidorLineaArduino.ino diff --git a/SeguidorLineaArduino/SeguidorLineaArduino.ino b/SeguidorLineaArduino/SeguidorLineaArduino.ino new file mode 100644 index 0000000..08ce8b7 --- /dev/null +++ b/SeguidorLineaArduino/SeguidorLineaArduino.ino @@ -0,0 +1,75 @@ + +int sensores[]={A0,A1,A2,A3,A4,A5,A6,A7};//Sensores +int valores[8]; +int umbral[]={1023,1023,1023,1023,1023,1023,1023,1023}; +int numSensores=8;//total de sensres en la barra +int ir =2;//encender y apagar la barra + + +void setup() { + Serial.begin(115200); + //Inicializamos los pines de los sensores + for(int x=0;x(umbral[x]+70)?(x*500)+500:0; + } +} + +void calibracion(){ + digitalWrite(LED_BUILTIN,HIGH); + for(int y=0;y<400;y++){ + for(int x=0;xv){ + umbral[x]=v; + } + } + delay(10); + } + + digitalWrite(LED_BUILTIN,LOW); +}